7. Migrating from One View Instance to Another

If you have more than one instance of the same Ambari View, you can migrate view data (for example, entity data, instance data and View USE permissions) from one instance to another. This is useful when a new view version is released and you want to migrate the view data from a view instance for the previous version to a view instance on the newer version.

[Note]Note

Migrating view data between instances is only supported for Hive, Pig and Tez views.

To migrate from view INSTANCEA (the source view instance) to view INSTANCEB (the target view instance), an Ambari Administrator can run the following command:

curl -v -u admin:admin -X PUT -H “X-Requested-By:1” http://AMBARI_SERVER_HOST:8080/api/v1/views/VIEW_NAME/versions/TARGET_VIEW_VERSION/instances/INSTANCEB/migrate/SOURCE_VIEW_VERSION/INSTANCEA

where:

  • AMBARI_SERVER_HOST is the Ambari Server hostname or IP address

  • VIEW_NAME is the name of the view

  • TARGET_VIEW_VERSION is the version of the target view

  • SOURCE_VIEW_VERSION is the version of the source view

    For example, if you are migrating from version 1.0.0 to 1.0.1, your SOURCE_VIEW_VERSION will be 1.0.0 and TARGET_VIEW_VERSION will be 1.0.1.

This command calls the method /migrate on the target instance and passes the original instance version and name.

To find out the view name, instance name, and view version:

  1. In the Ambari web UI, browse to the Ambari Administration interface.

  2. Click Views.

  3. Open a specific view.

For example: