Export API Script to export all entities and save it as zip file
mkdir /tmp/atlas_backup
cd /tmp/atlas_backup
for t in `cat metics_types.list`
do
mkdir -p $t
curl -k -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d "{\"itemsToExport\": [{\"typeName\": \"$t\"}], \"options\": {\"matchType\": \"forType\", \"fetchType\": \"full\"}}" "https://atlas_host:21443/api/atlas/admin/export" > $t/Atlas-$t.zip
done
Note: unzip and check one of the zip file. expect to see .json files with entities informations.
Steps to Import on CDP
Remediation steps
Unzip and extract the json files from the backup directory /tmp/atlas_backup. Expect to see .json file with entity information.
Replace the Atlas cluster_name in .json files with CDP Atlas cluster_name. Note: in CDP default value of cluster_name is 'cm'.
Replace the HDFS Namespace directory e.g hdfs://HDFSNamespace:8020/
Replace the patterns which are applicable in CDP e.g @cluster_name
Import API - Script to Import all entities from zip file
cd /tmp/atlas_backup
for t in `ls /tmp/atlas_backup/*/*.zip`
do
curl -ivk -X POST -u admin:admin -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d "{\"options\": {\"fileName\": \"$t\"}}" "https://atlas_host:21443/api/atlas/admin/importfile"
done