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: 

Is it possible to update managed location for a Schema in Unity Catalog after the migration

bhanu_dp
New Contributor III

In Unity Catalog, we can specify the managed location for a schema while creation.

However, say if we migrate the tables and schemas from Hive metastore to UC without specifying managed location while creating the schema in UC.

Is there a way to update or force the location on the schema, after the fact.

Other than recreating a new schema and moving the tables into to the new schema. And renaming them.

1 ACCEPTED SOLUTION

Accepted Solutions

Rjdudley
Honored Contributor

No, you can't.  You'll have to create a new schema, then recreate and reload your tables in the new schema (can't move tables, either).  I just had to do this all myself.

A place I look for information like this is the REST API, which is used by the UI, CLI and SDK.  If you look at "Update a schema" you'll see there is no option for storage_root: https://docs.databricks.com/api/azure/workspace/schemas/update

View solution in original post

2 REPLIES 2

Rjdudley
Honored Contributor

No, you can't.  You'll have to create a new schema, then recreate and reload your tables in the new schema (can't move tables, either).  I just had to do this all myself.

A place I look for information like this is the REST API, which is used by the UI, CLI and SDK.  If you look at "Update a schema" you'll see there is no option for storage_root: https://docs.databricks.com/api/azure/workspace/schemas/update

JissMathew
Contributor III

Hi @bhanu_dp 

In Databricks Unity Catalog, once a schema is created without specifying a managed location, you cannot directly alter the schema to set or change its managed location. The managed location is typically set at the time of schema creation and is used to determine where the data for managed tables within that schema will be stored.

If you need to change the managed location after the schema has been created, the typical approach would be to:

Create a New Schema with the Desired Managed Location:

Create a new schema and specify the desired managed location during its creation.
Move Tables to the New Schema:

Move the tables from the old schema to the new schema. This might involve copying the data and recreating the tables in the new schema.
Rename Tables if Necessary:

If you need to maintain the original table names, you might need to rename the tables after moving them.
Unfortunately, this process can be cumbersome, especially if you have a large number of tables or complex dependencies.

For the most accurate and up-to-date information, you should refer to the official Databricks documentation. As of my last update, there isn't a direct feature to alter the managed location of an existing schema in Unity Catalog. However, Databricks frequently updates its platform, so it's a good idea to check their documentation or contact their support for any new features or workarounds.

Jiss Mathew
India .

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now