Migrate catalogs from Databricks to Unity Catalog
Project description
Unity Catalog Migrate
Disclaimer: This project is unofficial and not affiliated with or endorsed by the official Unity Catalog team.
Migrate catalogs, schemas, and tables from Databricks to Unity Catalog.
Requirements
- Python 3.9 or higher
- Databricks configuration file: https://docs.databricks.com/en/dev-tools/auth/config-profiles.html
Installation
To install the Unity Catalog Migrator, you can use the following commands:
pip install unitycatalog-migrate
Usage
Migrate Catalogs
ucm migrate-catalog NAMES... --profile <databricks-profile>
Migrate Schemas
ucm migrate-schema FULL_NAMES... --profile <databricks-profile>
where FULL_NAMES are in the format catalog.schema
Migrate Tables
ucm migrate-table FULL_NAMES.. --profile <databricks-profile>
where FULL_NAMES are in the format catalog.schema.table
Configuration
The Unity Catalog Migrator uses the following environment variables:
- UC_HOST_URL: The URL of the Unity Catalog server. Default is
http://localhost:8080/api/2.1/unity-catalog. - UC_TOKEN: The token to authenticate with the Unity Catalog server. Default is
None. You can also pass the token as an argument to the command.
Example
# Use Databricks CLI to get tables
table_names=$(databricks tables list catalog1 schema1 --profile DATABRICKS_TEST | awk 'NR>1 {print $1}' | paste -sd ' ' -)
# Migrate the tables to Unity Catalog using ucm
echo $table_names | xargs ucm migrate-table --profile DATABRICKS_TEST
Remarks
- Catalog and Schema need to exist in Unity Catalog before migrating tables
Not supported:
- system tables
- Variant datatype
Contributing
- Contributions are welcome. Please fork and make a PR and I'll take a look asap.
- Star the repo if you like it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unitycatalog_migrate-0.1.1.tar.gz.
File metadata
- Download URL: unitycatalog_migrate-0.1.1.tar.gz
- Upload date:
- Size: 84.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2a5e81fec8692c5008271b90f5c893b7a7e6bd6f2fd3f999125ec73558b3a12
|
|
| MD5 |
f86fd22dfce544e2ba085eb6ca49367f
|
|
| BLAKE2b-256 |
a2c3acf1e87417c73715b0ba03c58f8314b41f8d8d981eeec1f9f2f1df3e5f3b
|
Provenance
The following attestation bundles were made for unitycatalog_migrate-0.1.1.tar.gz:
Publisher:
build-and-publish.yml on dan1elt0m/unitycatalog-migrate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unitycatalog_migrate-0.1.1.tar.gz -
Subject digest:
e2a5e81fec8692c5008271b90f5c893b7a7e6bd6f2fd3f999125ec73558b3a12 - Sigstore transparency entry: 165825830
- Sigstore integration time:
-
Permalink:
dan1elt0m/unitycatalog-migrate@a2602393efb0bd89d4412d9255bca82a8f793cc5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dan1elt0m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@a2602393efb0bd89d4412d9255bca82a8f793cc5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file unitycatalog_migrate-0.1.1-py3-none-any.whl.
File metadata
- Download URL: unitycatalog_migrate-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
329a5a99f704df18aa4b5e4ae9493116326c0f444b9a1fb128b0c782b25ffe12
|
|
| MD5 |
80870816ae62b614d46629145be52150
|
|
| BLAKE2b-256 |
7fe1ed8492115c31f2b896be02dc9dfc99ea01f08e083e64741599f5d929b793
|
Provenance
The following attestation bundles were made for unitycatalog_migrate-0.1.1-py3-none-any.whl:
Publisher:
build-and-publish.yml on dan1elt0m/unitycatalog-migrate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unitycatalog_migrate-0.1.1-py3-none-any.whl -
Subject digest:
329a5a99f704df18aa4b5e4ae9493116326c0f444b9a1fb128b0c782b25ffe12 - Sigstore transparency entry: 165825834
- Sigstore integration time:
-
Permalink:
dan1elt0m/unitycatalog-migrate@a2602393efb0bd89d4412d9255bca82a8f793cc5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dan1elt0m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@a2602393efb0bd89d4412d9255bca82a8f793cc5 -
Trigger Event:
release
-
Statement type: