cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
Join discussions on data governance practices, compliance, and security within the Databricks Community. Exchange strategies and insights to ensure data integrity and regulatory compliance.
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 !

 

3 REPLIES 3

ScottSmithDB
Valued Contributor
Valued Contributor

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 ! 

dkushari
New Contributor III
New Contributor III

Hi,

Looks like you are creating the catalog at the container level. Are there any other UC objects created pointing to that? Is the external location created at the container level? Can you please have a look at this and see if there is overlapping? Thanks!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!