Exporting and importing Transformation Advisor 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:

  • Transformation Advisor 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 Transformation Advisor running in IBM Cloud Private and it is to be imported to a newer version of Transformation Advisor running in OpenShift Container Platform.

How to export your data from Transformation Advisor in OpenShift Container Platform

First follow the guide Using the Transformation Advisor APIs to obtain the user token for authentication and the interactive UI for the OpenAPI endpoints.

In addition, this method makes use of endpoints exposed on TA Web Server that are different from the OpenAPI ones. To locate the URL for these endpoints:

  • Launch the OpenShift Container Platform Console UI.
  • Click on Home > Projects and select the project for Transformation Advisor.
  • Click on Networking > Routes and select the server-route.
  • Find Location, which provides the value for <TA_WEB_SERVER> (e.g. at https://ta-ta.apps.apps.myinstance.host.com/lands_advisor)

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 is any issues with exporting all the zip files, follow the steps below 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_<timestmap>.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 Transformation Advisor 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 Transformation Advisor in OpenShift Container Platform or TA-LOCAL

Using the Swagger UI

First follow the guide Using the Transformation Advisor APIs to obtain the user token for authentication and the interactive UI for the OpenAPI endpoints.

Import more than 1 zip file at a time

You can import as many zip files as you like in one go by following the steps below

  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 be 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 via the UI of the target Transformation Advisor 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"

.