3 Migrate to Oracle Mobile Hub

Oracle recommends that you simulate running the migration tool from end to end, but without modifying the OMH target. That is, creating the export bundles but not importing them into the target Mobile Hub. This allows you to check that the values in the config.json file are correct, and that there are no conflicts in the data.

The migration tool runs in Docker, an open platform for building, shipping, and running distributed applications. It gives programmers, development teams, and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications. You'll need to have Docker installed on your system to run the migration tool.

For more information about Docker, see the Docker documentation at www.docker.com.

Build the Docker Container

After updating the config.json for your source instance, you build the Docker container so that you can run the migration tool.

Use the docker build command to create a Docker image. It uses the definition contained in the Dockerfile which is part of the migration tool.

docker build -t mcs-migration .

Alternatively, if you are using a proxy:

docker build \
  --build-arg "http_proxy=http://www-proxy.example.com:80" \
  --build-arg "https_proxy=http://www-proxy.example.com:80"\  
  -t mcs-migration .

In both examples, there is a dot at the end which is a shortcut for the current directory, assuming that you are working in the directory where the migration tool was unzipped.

The Docker image is ready when you see Successfully built.

Test the Migration

Every time you run migrate a new migration bundle is created and uploaded (exported) into storage. You can use commands that specify a bundle to identify issues when an export (to storage) or an installation or import (from storage to the target instance) fails.

  1. Run the test migration using:

    docker run -it mcs-migration python migrate.py migrate -n
  2. Check the output.

    • If the overall status is SUCCESS, you can proceed to run the migration.

    • If the status shows FAILED or PART_FAILURE, examine the output to see where the failure occurred.

    • If export failed, show the status of the export using:

      docker run -it mcs-migration python migrate.py export_status bundle_name
    • If install failed, show the status of the installation using:

      docker run -it mcs-migration python migrate.py install_status bundle_name

      Resolve any conflicts that are reported.

Migration Tool Commands

Command Description
docker run -it mcs-migration python migrate.py migrate -n Run to export to a storage bundle without modifying the target Mobile Hub instance.
docker run -it mcs-migration python migrate.py export_status <bundle_name> Run to show the export status after FAILED or PART_FAILURE.
docker run -it mcs-migration python migrate.py install_status <bundle_name> Run to show the installation or import status after FAILED or PART_FAILURE.
docker run -it mcs-migration python migrate.py migrate Execute migration from the source instance to Mobile Hub.
docker run -it mcs-migration python migrate.py -h Run to see help.
docker run -it mcs-migration python migrate.py export Export data from the source instance to storage.
docker run -it mcs-migration python migrate.py list List the bundles available in storage for installation in the Mobile Hub instance.
docker run -it mcs-migration python migrate.py install <bundle_name> -n Simulate installing or importing the specified bundle from storage to Mobile Hub during a test migration.
docker run -it mcs-migration python migrate.py install <bundle_name> Install or import the specified bundle from storage in the target Mobile Hub instance.
docker run -it mcs-migration python migrate.py migrate -n -s

(Migration from MCS only.)

When testing the migration, excludes the following from migration:

  • Metadata for clients having same set of platform, version and Bundle ID (other names Application ID or Package Name) in the source instance.

    These are not supported in Mobile Hub and conflicts might not be resolved in the MCS production environment.

  • User-Isolated Collections tables that cannot be migrated because of missing IDCS users in the Mobile Hub instance.

    You should migrate users from the traditional cloud account (MCS) to Oracle Identity Cloud Service (for Mobile Hub) before performing the migration.

docker run -it mcs-migration python migrate.py migrate -s -d

(Migration from MCS only.)

As above, but dismisses objects that have no owner in IDCS.

docker run -it mcs-migration python migrate.py migrate -s

(Migration from MCS only.)

As above, but when running the end-to-end migration.

docker run -it mcs-migration python migrate.py cleanup

(Migration from MCS only.)

Use to cleanup the target instance in case of conflicts.

This command removes all supported artifacts, including demo data. Oracle recommends you only use this for testing migration.

WARNING:

Only run this on an Mobile Hub instance that has nothing you care about on it, since everything will be deleted.
The supported types which are removed are:
  • metadata
  • location data
  • collection objects for migrated collections
docker run -it mcs-migration python migrate.py cleanup_storage Every migrate operation uploads a new migration bundle into configured Object Storage and leaves it there so you can examine it for conflicts or other issues. Use this task to remove all bundles.
docker run -it mcs-migration python migrate.py cleanup_storage <bundle_name> Use to clean up (remove) a specific bundle.

Perform the Migration

When you have tested that the migration tool is working correctly, you can migrate data from the source instance to Mobile Hub.

Run this command:

  • docker run -it mcs-migration python migrate.py migrate

Bundles are created in the source instance and exported to the storage instance. Then they are imported to the target Mobile Hub.

The migration is complete when the overall status is SUCCESS.

In Mobile Hub, check that you can see the correct:

  • Mobile Backends
  • Client Management
  • APIs
  • Connectors
  • Collections
  • Policies
  • Location data
  • Tables created by Database Access and Management APIs
  • Analytics data (migration from MCS only)

Use a Custom config.json

You can run a migration tool command using a custom config.json without rebuilding the docker image using this command and appropriate arguments:

docker run -v ${PWD}/config.json:/migration/config.json -it
          mcs-migration python migrate.py <arguments>

User-Isolated Collection Objects (MCS Only)

When the data to be migrated includes user-isolated storage collection objects, users need to be migrated from the traditional cloud account (MCS) to IDCS (for OMH) before the migration tool is run. Otherwise, migration will fail because the associated users are not present in the OMH instance.