cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
cancel
Showing results for 
Search instead for 
Did you mean: 

Create a catalog with external location from different Metastore

erigaud
Honored Contributor

Hello community !

Here's my problem : I had a workspace with Unity Catalog enabled, and a catalog stored on an external location (Azure storage account). All my schemas and tables were storage on this storage.

erigaud_0-1713797409085.png

 

However we recently deleted the metastore, and created a new one. 

I am wondering if it is possible to re-create a catalog by specifying the same external location, to access all my schemas and tables again ? 

I tried doing so but I no longer see my schemas and tables on Databricks, so I am wondering if now that the metastore changed, I will not be able to see my tables ? 

Thank you for the help !

 

2 REPLIES 2

ScottSmithDB
Contributor III
Contributor III

If both the Catalog and the Schema and tables are stored externally, and you have deleted the original catalog, you should be able to recreate the schema in a new catalog by pointing it to the previous data files and running the SYNC command. Here are the steps .
1. Define an External Location in the new catalog that points to the same location where your previous data files are stored. Sounds like you did this.
2. Use the SYNC command to create a new Unity Catalog table based on your legacy table location. This will only create metadata and not change the underlying data. The syntax is as follows:

SYNC hive_metastore.schema.table uc_catalog.schema.table This command will create a new table in your new catalog that points to the same data files as your old table.  It sounds like you may not have done this.

Note that the SYNC command assumes that the data files are still in the same location and have not been moved or deleted. If the data files have been moved, you will need to adjust the External Location accordingly.

Hope this is helpful.

erigaud
Honored Contributor

I have an issue when trying to create a new catalog based on the previous catalog location : 

erigaud_0-1714038636622.png

Any idea ? Thanks Scott ! 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.