XRAY: How to transfer Xray configuration settings from On-prem Artifactory to a cloud Artifactory instance
In this article, we will discuss how to transfer Xray configuration settings from On-prem Artifactory to a cloud Artifactory instance.
Export Xray configurations from On-prem Artifactory:First we need to run the Xray Export REST API on the On-prem Artifactory instance by mentioning the required configurations to be transferred in the input JSON file. Below I have exported all the configurations by providing “"export_all" : true” as input to the Xray Export REST API.
$curl -uadmin:${PASSWORD} -X POST https://On-prem-server/xray/api/v1/configuration/export -H 'Content-Type: application/json' -d '{"export_all" : true}'It will generate an exported zip file under the below Xray path of the On-prem instance with all the configurations.
“/opt/jfrog/xray/var/work/server/backup/config/jfxr@0123abc_xray_exported_config_XXXX.zip”
Import Xray configurations to Cloud Artifactory:We need to copy the exported Zip file “jfxr@0123abc_xray_exported_config_XXXX.zip” with Xray configurations of On-prem to the same path of the cloud instance under
“/opt/jfrog/xray/var/work/server/backup/config/xray_exported_config_XXXX.zip”
As it was a cloud instance, customers won't be having access to the cloud servers to copy the exported Xray configurations file. So they will provide the generated xray exported configuration file for the On-prem Artifactory to us. Support will work with Production Engineering to place the exported file under the required xray path on the corresponding cloud Artifactory server.
Now we will provide the complete path of the exported zip file on the cloud Artifactory server and ask the customer to run the Xray Import REST API on their cloud Artifactory by providing the src_path of the exported file as below.
$ curl -uadmin:${PASSWORD} -X POST https://saas-server/xray/api/v1/configuration/import -H 'Content-Type: application/json' -d '{"src_path" : "xray_exported_config_XXXX.zip"}'
This will successfully transfer the Xray configuration settings from On-prem Artifactory to a cloud Artifactory instance.