Skip to main content

Migrate catalogs from Databricks to Unity Catalog

Project description

Unity Catalog Migrate

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.0.tar.gz (83.5 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.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file unitycatalog_migrate-0.1.0.tar.gz.

File metadata

  • Download URL: unitycatalog_migrate-0.1.0.tar.gz
  • Upload date:
  • Size: 83.5 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.0.tar.gz
Algorithm Hash digest
SHA256 98875badac3d00dd9717ca3d65e8c5cf5c9e08a97f76d25c862f21d0c8b4641b
MD5 4ae02b375d162b41819a7fe61122495a
BLAKE2b-256 73d9cd51b99b65c2db0621963ce01d67b273becd7ed22bdfe7af0f00e4122757

See more details on using hashes here.

Provenance

The following attestation bundles were made for unitycatalog_migrate-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unitycatalog_migrate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c38989f7b42d97ef0657e1a4d41a4e995402bf2c7953c3bf7c6b174272feb493
MD5 3ec3f69a9ce494c3a49ace50e9e10552
BLAKE2b-256 347e5b53daf58f9a286f282d1f11ea043b8c3e822e370b5d433b43c0eb9b3aaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for unitycatalog_migrate-0.1.0-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