Exporting and importing Application Modernization Accelerator data via HTTP endpoints

This method does NOT involve locating and copying the underlying data from a CouchDB pod and hence can be helpful in these scenarios:

  • Application Modernization Accelerator is configured to use dynamically provisioned storage.
  • Only some particular parts of the data need to be exported.
  • The data to be exported is from an older version of Application Modernization Accelerator running in IBM Cloud Private and it is to be imported to a newer version of Application Modernization Accelerator running in OpenShift Container Platform.

How to export your data from Application Modernization Accelerator in OpenShift Container Platform

  • Launch the OpenShift Container Platform Console UI.
  • Click on Home > Projects and select the project for Application Modernization Accelerator.
  • Click on Networking > Routes and select the openapi-route.

Using the Swagger UI

Export all zip files

  1. Use the bulkExport command in the Swagger UI to export all the zip files img.png
  2. If there are any issues with exporting all the zip files, perform the following steps to export the zip files for each workspace.

Export all zip files for a workspace

  1. Use the workspace bulkExport command in the Swagger UI to export all the zip files for the given workspace img.png
  2. Look up the workspaceId of the workspace via the GET /advisor/v2/workspaces OpenAPI endpoint and use this value.

Using the Command Line

Export all zip files

To export the original zip files you can use the bulkExport API.

  1. Execute the following command:
    GET /advisor/v2/collectionArchives/bulkExport

Export all zip files for a workspace

To export the original zip files you can use the bulkExport API.

  1. Look up the workspaceId of the workspace via the GET /advisor/v2/workspaces OpenAPI endpoint.
  2. Execute the following command:
    GET /advisor/v2/workspaces/{workspaceId}/collectionArchives/bulkExport

This will return a zip file called TA_bulkExport_<timestamp>.zip. The zip file has a hierarchical structure:

  • At the first level is a directory for the workspace.
  • At the second level there is a directory for each collection.
  • Each collection directory will have 0-n zip files that were originally uploaded.

How to export your data from Application Modernization Accelerator in TA-LOCAL

For TA-LOCAL, the steps are similar to the previous steps except for the following:

  • There is no need to obtain a user token for authentication.
  • Remove the --header="Authorization: Bearer <USER_TOKEN>" part of all commands.
  • The value for <TA_WEB_SERVER> is <TA_LOCAL_UI_HOST>:2220/lands_advisor.

How to import your data to Application Modernization Accelerator in OpenShift Container Platform or TA-LOCAL

Using the Swagger UI

To obtain the user token for authentication and the interactive UI for the OpenAPI endpoints, see the Using the Application Modernization Accelerator APIs guide.

Import more than one zip file at a time

You can import as many zip files as you like in one go by following these steps:

  1. Zip all the zip files into a single zip file.
  2. Change the name of this zip file to be the name of the workspace you want to create.
  3. Use the bulkImport command in the Swagger UI to import all the zip files img.png
  4. Make sure you set the noHierarchy flag to true.
  5. Attach the zip file and enter its name for the bulkArchiveName.
  6. Press Execute.
  7. As soon as the file is uploaded to the server, the API will return with a URL (upload is complete but processing is still ongoing).
  8. Open that URL to see the progress of the upload. Refresh this page to see further progress.

Using the Command Line

Import a specific zip file

The simplest way is to upload the exported files by using the UI of the target Application Modernization Accelerator instance.

Alternatively, the original report archives and application dependency files can also be uploaded via an HTTP endpoint via the following steps:

To upload the original report archives, go to the interactive UI of the OpenAPI endpoints and use the following REST method:

POST /lands_advisor/advisor/v2/workspaces/{workspaceId}/collectionArchives

Import all zip files for a workspace

If you have a bulkExport zip file you can use the bulkImport API to upload all the zip files at once. The following command assumes you have renamed your bulkExport file to bulkExport.zip and it is located at /root.

curl -X POST "<TA_WEB_SERVER>/lands_advisor/advisor/v2/collectionArchives/bulkImport" -H "accept: */*" -H "archiveName: bulkExport.zip" -H  "Authorization: Bearer <USER_TOKEN>"  -H "Content-Type: application/octet-stream" --data-binary "@/root/bulkExport.zip"