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 includes exporting the current Xray server configurations and importing them to the new server.
At the source instance (current Xray server):
- Run the Export Xray Settings REST API call. This call will export the Xray server’s configurations to a .zip file in $JFROG_HOME/xray/var/backup/config.
- Stop Xray
- Install the desired JFrog Xray version 3.x and make sure to connect it to your Artifactory server.
- Start Xray
- Run the Import Xray Configurations REST API call. This call will import the former server’s configurations to the new one.
Export.json:
{ "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" :"<your_Artifactory_instance_id>" #this value is configured from the UI in the Administration tab >> General >> Settings >> Server Name }The Import Xray Configurations REST API call also consumes a .json file which contains the instance_id and the path the exported settings .zip file as shown below:
Import.json:
{ "instance_id" : "<your_Artifactory_instance_id>", "src_path" : "$JFROG_HOME/xray/var/work/server/backup/config/<SERVICE_ID>_xray_exported_config_<TIMESTAMP>.zip" #the path to the zip file that was generated from the export command. It should be located in $JFROG_HOME/xray/var/work/server/backup/config }Two important notes to keep in mind:
- The <SERVICE_ID>_xray_exported_config_<TIMESTAMP>.zip file generated by the Export REST API call should be owned by the user and group xray.
- The migration process does not include the DB sync, meaning, you will have to re-run the DB sync in the new server.
- After the migration is completed, Xray will still need to reindex and analyze the available resources for the Xray data to be displayed.