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:ย 

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_Fatma
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

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