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:
- Get an authentication token (for release 19A and lower), if you are fetching an authentication token for sites 19A and lower.
- Get an authentication token (for release 19B and higher), if you are fetching an authentication token for sites 19B and higher.
Create a Package on the Source Environment
- 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 exportid
that you get in the response. - 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. - 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
- 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:
- Open the Swagger UI tool.
- Under Import, click the
POST operation for
/elementmanager/import/EMPackages
. - Scroll down to the Base64 Encoder Tool.
- Click Choose File, browse and select the export zip file package, and click Open.
- 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.
- 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 importid
that you get in the response. - 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. - Perform the actual import by using the Import or rollback a package operation by setting the value of the
action
parameter asimport
, and providing the same importid
. - 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 theaction
parameter asrollback
, and providing the same importid
. You can verify the status of the rollback by using the Get an import package status operation by providing the same importid
.