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 and select the project for Application Modernization Accelerator.
- Click on
and select
the
openapi-route.
Using the Swagger UI
Export all zip files
- Use the
bulkExportcommand in the Swagger UI to export all the zip files
- 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
- Use the
workspace bulkExportcommand in the Swagger UI to export all the zip files for the given workspace
- Look up the
workspaceIdof the workspace via theGET /advisor/v2/workspacesOpenAPI 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.
- 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.
- Look up the
workspaceIdof the workspace via theGET /advisor/v2/workspacesOpenAPI endpoint. - 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:
- Zip all the zip files into a single zip file.
- Change the name of this zip file to be the name of the workspace you want to create.
- Use the
bulkImportcommand in the Swagger UI to import all the zip files
- Make sure you set the noHierarchy flag to true.
- Attach the zip file and enter its name for the bulkArchiveName.
- Press Execute.
- 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).
- 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"