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: 

How to Import an old Unity Catalog Metastore to a new Unity Catalog Metastore?

Barney
New Contributor II

Hi All,

I have created a new Unity Catalog (UC) metastore (new metastore ID) in west europe and now i want to import alle catalog/schema/tables form the old metastore (west europe) container to the new UC metastore.

Note: coping all tables form the old metastore container to the new metastore container didn't works.

6 REPLIES 6

Anonymous
Not applicable

@Ron Barneveld​ :

To import all the catalog/schema/tables from the old Unity Catalog (UC) metastore to the new one, you can use the 'Export Metadata' and 'Import Metadata' functionalities provided by Databricks.

Here are the high-level steps to do this:

  • Export metadata from the old metastore container to a file. You can do this using the databricks workspace export command in the Databricks CLI
databricks workspace export /FileStore/my-metadata-folder/metadata.json

  • Copy the exported file to a location that is accessible from the new Databricks workspace
  • Import metadata from the exported file to the new metastore container. You can do this using the databricks workspace import command in the Databricks CLI. This command will import all the objects defined in the metadata file, including notebooks, libraries, and other artifacts. If you only want to import the catalog/schema/tables, you can filter the metadata file to include only the relevant objects before importing it
databricks workspace import /FileStore/my-metadata-folder/metadata.json

  • Verify that the catalog/schema/tables have been imported correctly by checking the Unity Catalog UI in the new Databricks workspace

Barney
New Contributor II

Hi Suteja,

Thanks for your reply. You mention these: databricks workspace export /FileStore/my-metadata-folder/metadata.json but the statement should be like this: databricks workspace export [OPTIONS] SOURCE_PATH TARGET_PATH , right? There must be a SOURCE_PATH of the UC metastore, so where can i find the metadata of the UC metastore that i can export. It doesn't exist in the Databricks workspace filefolder.

By the way i still have my old UC metastore in the ASDL.

Anonymous
Not applicable

Hi @Ron Barneveld​ 

Hope everything is going great.

Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you. 

Cheers!

Barney
New Contributor II

Hi Vidula,

I am afraid that our issue is still not resolve. We have created the default UC metastore on prod.

We understand that we wouldn't delete a metastore on daily bases but we still interesting if it's possible to export/import the metadata of an UC metastore.

Thanks any for your interest!

Ron (Barney)

drii_cavalcanti
New Contributor III

Hi Barney,

Just wondering if you got this issue solved.

Thank you so much,
Adriana Cavalcanti

@Retired_mod  @Barney Will this method work to import table and column metadata from one metasrore to another in unity catalg? I thought this only works when upgrading tables from legacy hive_metastore to a catalog in unity-catalog ?   

I have a spreadheet containing table & column descriptions (comments)  Is there a way to upload this against the schema in unity catalog?  Basically instead of running  'Alter table <> alter column <>  comment "description"  '  these commands for every column, is there a way to mass apply column comments in unity catalog schema? 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group