XRAY: How to migrate Xray to another server using the same database
This article explains the migration process for JFrog Xray from one server to another server using the same external Postgres database. In this case, the configurations and scan data remains persistent even after the migration process. Please note that this migration is applicable between two servers with the same Xray version installed.
Procedure to migrate the Xray data from one server to another server:Prerequisites:
- Make sure to take a snapshot/backup of the current Xray and Postgres Database.
- Migration applies between the same Xray versions.
Required actions on source instance (current Xray server):
3. Stop the old Xray server services. For example, we can use the below command to stop service in service installation.
systemctl stop xray.service
4.Copy the content from $JFROG_HOME/xray/var/ directory to the new server.
Required actions on the target instance (new Xray server):
5. Install XRAY on a new server with the same version(DO NOT START the Xray Services).
6. Copy the "$JFROG_HOME/xray/var/" content of the old Xray server to the same location on the new Xray server.
7. Make sure to change folder privileges on the new server (Use below command if Xray running with xray user). We need to make sure to have the right privileges according to the Xray installation type.
chown -R xray:xray $JFROG_HOME/xray/var/
8. Edit the system.yaml file and update following parameters:
- RabbitMQ - Change password to plain text.
- PostgreSQL DB - change password to plain test
- Update new VM IP address in "shared.node.ip" (node section)
9. Once above changes are performed, start the Xray services on the new server and check if there are any issues.
systemctl start xray.service
10. If you notice any issues, we may restore to old snapshots.
We will be copying the data(i.e. $JFROG_HOME/xray/var/") between Xray servers in order to make sure both servers are using the same master key.
Please feel free to reach out to JFrog Support incase if you notice any issues during this migration process.