Skip to main content

Migrate catalogs from Databricks to Unity Catalog

Project description

test Python Version from PEP 621 TOML

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unitycatalog_migrate-0.1.1.tar.gz (84.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unitycatalog_migrate-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for unitycatalog_migrate-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e2a5e81fec8692c5008271b90f5c893b7a7e6bd6f2fd3f999125ec73558b3a12
MD5 f86fd22dfce544e2ba085eb6ca49367f
BLAKE2b-256 a2c3acf1e87417c73715b0ba03c58f8314b41f8d8d981eeec1f9f2f1df3e5f3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for unitycatalog_migrate-0.1.1.tar.gz:

Publisher: build-and-publish.yml on dan1elt0m/unitycatalog-migrate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unitycatalog_migrate-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for unitycatalog_migrate-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 329a5a99f704df18aa4b5e4ae9493116326c0f444b9a1fb128b0c782b25ffe12
MD5 80870816ae62b614d46629145be52150
BLAKE2b-256 7fe1ed8492115c31f2b896be02dc9dfc99ea01f08e083e64741599f5d929b793

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page