Create path mappings
Create path mappings when you want to define an alternative target path for a specific target filesystem.
Why use path mapping?
If you don't map paths, the source path on your source filesystem is created on your target filesystem. This may not always be suitable for your migration.
The following example shows a common use case where the default Hive metastore warehouse directory for Hortonworks is /apps/hive/warehouse
, and the default for Azure HDInsight is /hive/warehouse
.
Example for Hortonworks to HDInsight | Source path | Target path |
---|---|---|
Without path mapping | /apps/hive/warehouse | /apps/hive/warehouse |
With path mapping | /apps/hive/warehouse | /hive/warehouse |
Using path mapping enables any migrated data (relating to managed Hive databases and tables) to be stored in the equivalent default location on the target.
Create a path mapping with the UI
You can create path mappings through the UI. To access path mappings:
- From your Dashboard, select the product under Products.
- Under the Migrations menu, select Path Mappings.
Here, you will see a list of any existing path mappings.
Add a path mapping
To add a path mapping, select Add new path mapping.
In the form that appears, enter the following details:
- Name: A reference name for your path mapping.
- Source Filesystem: The filesystem source. Selectable via a drop-down menu.
- Path for <Source_Filesystem_Name>: The directory path on the source filesystem to map from. Appears only after selecting a source filesystem.
- Target Filesystem: The target filesystem to map to in migrations. Selectable via a drop-down menu.
- Path for <Target_Filesystem_Name>: The directory path on the target filesystem to map to. Appears only after selecting a target filesystem.
Select Add once you've entered all necessary information to create your new path mapping. The path mapping is then added to the Path Mappings tab.
Remove a path mapping
To delete a path mapping, locate the path mapping you want to remove in the list and select the trash can icon next to it.
When you delete a path mapping, migrations using the path mapping aren't affected. They continue to function as if the path mapping were still in place.
Create a path mapping with the CLI
Add path mappings
Use the path mapping add
command to define your source and target paths, as well as your target filesystem.
Manage path mappings
Command | Action |
---|---|
path mapping delete | Delete a path mapping |
path mapping list | List all path mappings or list path mappings for a specific filesystem |
path mapping show | Show details of a specified path mapping |
Path mapping limitation
Paths on the source filesystem will not be migrated if they conflict with target paths that are created by the path mapping rules.
An example would be if you had a path mapping rule such as below:
Source path | Target path |
---|---|
/repl/folder/old | /repl/folder/old/archive |
In this case, if a new directory is created on the source /repl/folder/old/newdir
, it is migrated to the target as /repl/folder/old/archive/newdir
.
However, if the following directory is created on the source /repl/folder/old/archive
, this would not be migrated as it conflicts with the path mapping rule.
Next steps
Once you have defined any path mappings and exclusions, you're ready to migrate data.