How to migrate Xray configurations to another server
Migrating Xray to another instance is a fairly simple procedure which requires knowing how to install Xray and how to run a REST API call.
This procedure includesexportingthe current Xray server configurations andimportingthem to thenew server.
At the source instance (current Xray server):
- Run theExport Xray SettingsREST API call. This call will export the Xray server’s configurations to a .zip file in$JFROG_HOME/xray/var/backup/config.
- Stop Xray
At Destination instance (new Xray server):
- Install the desired JFrog Xray version 3.xand make sure to connect it to your Artifactory server.
- Start Xray
- Run theImport Xray ConfigurationsREST API call. This call will import the former server’s configurations to the new one.
The Export Xray Settings REST API callconsumes a .json filewhich contains the information you wish to export andcreates a .zip filein$JFROG_HOME/xray/var/backup/config. In the below example I chose to export all settings, however, in case you don’t want to export all of them, simply set the non-desired value to false:
Export.json:{The Import Xray Configurations REST API callalso consumes a .json filewhich contains the instance_id and the path the the exported settings .zip file as shown below:
"policies" : true,
"watches" : true,
"ignore_rules" : true,
"custom_licenses" : true,
"custom_issues" : true,
"webhooks" : true,
"mail_server" : true,
"proxy_config": true,
"indexed_resources" : true,
"instance_id" :"
}
Import.json:{Two important notes to keep in mind:
"instance_id" : "
"src_path" : "$JFROG_HOME/xray/var/work/server/backup/config/
}
- The
_xray_exported_config_ file generated by the Export REST API call should beowned by the user and group xray..zip - The migration processdoes not include the DB sync, meaning, you will have tore-run the DB syncin the new server.
- After the migration is completed,Xray will still need to reindex and analyze the available resourcesfor the Xray data to be displayed.
