HMS Mirror command summary

There are several critical options you need to use with the hms-mirror command to migrate HDP to CDP migration.

Run the following HMS Mirror help command, or go to the Cloudera HMS Mirror github site, to see a description of all command options:
hms-mirror -h
For the HDP to CDP migration, you generally use the subset of options shown in the following command:
hms-mirror -db <database name> -ma -mnn -e
-asm
Migrate avro based schema tables.
-d,--data-strategy <strategy>
Specify how the data will follow the schema. [SCHEMA_ONLY, LINKED, SQL, EXPORT_IMPORT, HYBRID, CONVERT_LINKED, STORAGE_MIGRATION, COMMON]
-da, -downgrade-acid
Downgrade ACID tables to EXTERNAL tables with purge.
-db [<db1,db2,..>]
Comma separated list of databases (up to 100) where dbn is the database name. The database name is optional, only required if the database value is null in the YAML configuration file.
-dc, --distcp
Generate the distcp commands.
-e, --execute
Executes HMS Mirror. Omit for a dry run.
--hadoop-classpath
Required for migrating from a Kerberos-enabled HDP cluster. For more information, see HMS Mirror documentation.
-ma | --migrate-acid
Manage managed tables, translating source metadata to the destination.
-mao
Migrate only acid tables.
-mnn
Manage non-native tables, such as HBase/Kafka/JDBC backed hive tables, translating source metadata to the destination.
-mnno
Migrate only non-native tables.
-o <output directory>
Output directory location.
-s, --sync
Drop metadata on the destination CDP One cluster if it does not match the definition on the HDP source cluster. (Ideally, there should not be any data on the destination cluster before metadata migration.)
--setup
Creates a default.yaml file in the $HOME/.hms-mirror/cfg/ directory by prompting you for information about your migration. You customize the YAML manually for your migration.
-v | --views-only
Migrates only VIEWs between two environments. This option alone must be run to separately generate views.

You can run any combination of options, except -v, which only migrates views. Run HMS Mirror to migrate views separately. VIEW creation requires dependent tables to exist. Run hms-mirror to create all the target tables before running it with the -v option.

This flag is an OR for processing views OR tables. They are NOT processed together.

Requirements:

  • The dependent tables must exist in the RIGHT cluster
  • When using -dbp|--db-prefix option, VIEW definitions are not modified and will most likely cause VIEW creation to fail.