Migrate Resources

You can use Oracle B2C Service Element Manager REST APIs to migrate resources across B2C Service instances. For example, you may want to migrate the required resources from a test environment to a production environment. Let's see how you can use the REST APIs to do this.

Prerequisites

Make sure you have the following information:

  • The REST API server URL for the source environment from where you want to export the resources.
  • The REST API server URL for the destination environment to which you want to import the resources.
  • The names of resources that you want to migrate.
  • The authentication token. You must obtain an authentication token to access the REST API operations. You must use one of the following operations to obtain an authentication token:

Create a Package on the Source Environment

  1. Initiate an export using the Create an export package operation by specifying the resources that you want to export.

    Note:

    Make a note of the export id that you get in the response.
  2. Verify the status of the export using the Get an export package status operation by providing the export id you noted down in the previous step. Ensure that the export preparation is completed.
  3. Download the export package using the Download an exported package operation by providing the same export id.

    This downloads a zip file, which contains the following files:

    • Report: This folder contains the actual data being exported.
    • EEMManifest.xml: This file is used to track the exports related to resource dependencies.
    • MetaData.json: This file contains details about the user permissions that need to be migrated from the source environment to the destination environment.

Import the Package on the Destination Environment

  1. Convert the export package, which you created on the source environment, to Base64 format. You can use the Base64 Encoder Tool or use any Base64 conversion utility to do this. Use this procedure to convert the export package to Base64 format using the Base64 Encoder Tool:
    1. Open the Swagger UI tool.
    2. Under Import, click the POST operation for /elementmanager/import/EMPackages.
    3. Scroll down to the Base64 Encoder Tool.
    4. Click Choose File, browse and select the export zip file package, and click Open.
    5. Click Upload and Convert.

      The export package is converted to Base64 format and the Base64 output is displayed.

      Note:

      Copy the Base64 output content in a text editor.
  2. Initiate an import using the Create an import package operation by providing the Base64 output, which you created in the previous step, in the packageContent parameter.

    Note:

    Make a note of the import id that you get in the response.
  3. Verify the status of the import using the Get an import package status operation by providing the import id you noted down in the previous step. Ensure that the import prescan is completed.
  4. Perform the actual import by using the Import or rollback a package operation by setting the value of the action parameter as import, and providing the same import id.
  5. Verify the status of the import using the Get an import package status operation by providing the same import id. Ensure that the import is completed.

    Note:

    If you want to rollback the import, you can use the Import or rollback a package operation by setting the value of the action parameter as rollback, and providing the same import id. You can verify the status of the rollback by using the Get an import package status operation by providing the same import id.