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

Restoring delta tables from an old metastore to the new one.

drii_cavalcanti
New Contributor III

Hi everyone,

Just wondering if I copy the catalog folders (under the metastore storage) to a different s3 bucket, once I have a new metastore with a new ID I can restore the tables as they were <catalog_name>.<schema_name>.<table_name> into the new metastore by using COPY INTO command.

Thank you all!

2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @drii_cavalcanticopying the catalog folders to a different S3 bucket will not restore the tables in the new metastore. The COPY INTO command loads data from a source (like an S3 bucket or ADLS Gen2 container) into a table in a Databricks workspace. It does not restore metadata about the table, like its schema or partitioning. When creating a new metastore, you need to specify a storage location to store all of the megastore's managed tables. However, this does not automatically restore the tables from an old metastore. You would need to recreate the tables in the new metastore, and then you can use the COPY INTO command to load the data from the S3 bucket into the planes.

Hi Kaniz,

thanks for your reply.

The tables in the old metastore were external managed tables. I have copied them to a new bucket and then now I was hoping to get them back into the new metastore by creating an external location and a credential storage.

I was wondering if there was a way to map them back into the correct namespace in the new metastore. I saw that in the external bucket, the folder tables only has tables identified by their ids so then I wanted to find somehow a table called tables in the information_schema and from there, be able to do the mapping.

Adriana C

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.