How to upgrade Xray to version 3.x from version 2.6 and below?

How to upgrade Xray to version 3.x from version 2.6 and below?

AuthorFullName__c
Kfir Avraham
articleNumber
000004816
ft:sourceType
Salesforce
FirstPublishedDate
2020-05-21T07:35:21Z
lastModifiedDate
2024-03-10T07:45:51Z
VersionNumber
6

Summary

In order to upgrade Xray from version 2.x to 3.x it would be required to first upgrade Xray to version 2.7 and above in case an older version (version 2.6 and below) is currently installed.

In case Xray is already running on version 2.7 or above, it is possible to continue and follow the upgrade instructions as mentioned in “Upgrading from Version 2.7 to 3.x” section in the official “Upgrade Xray” wiki page.

Why is it required to upgrade Xray to version 2.7 before the upgrade to version 3.x?

From version 3.x, MongoDB will not be used by Xray and is no longer needed, except during the initial migration phase from version 2.x. The data will be automatically migrated from MongoDB to PostgreSQL from version 2.7 and above (version 2.x).

Important note

Data migrations may not be performed during the upgrade process itself and will be required to start Xray after the upgrade to version 2.x before continuing the upgrade to version 3.x. 

This is because during the upgrade process itself Only Db migrations will be performed (not data).

Please note data migrations are ongoing migrations which may run for a long time, depending on the amount of data.

How to verify the migration process finished and it is possible to continue and upgrade Xray to version 3.x?

For this purpose it is possible to download the “xray-migration-readiness” tool (from the links below) which samples the MongoDb and verifies that all needed data migrations are finished.
It will be required to provide a URL, username and password or otherwise, simply provide the connection string to MongoDB.



Instructions:

1. Download the tool with the needed architecture 

2. Add permissions:  $ chown +x ./xray-migration-readiness-${ARCH}

3. Run: $ ./xray-migration-readiness-${ARCH} 

User-added image 

4. Run the script with needed parameters, for example:

a. With connection string:

$ ./xray-migration-readiness-darwin-amd64 start --connectionString mongodb://127.0.0.1:27017/?authSource=xray&authMechanism=SCRAM-SHA-1


b. With other parameters:

$ ./xray-migration-readiness-darwin-amd64 start --mongoUrl 127.0.0.1:27017 --username xray --password password --db xray
 

Expected results

[2020-05-03 | 08:35:10] - Sample MongoDB to check if JFrog Xray finished with previous migrations.
[2020-05-03 | 08:35:10] - Connect to MongoDB (timeout: 60 seconds) ...
[2020-05-03 | 08:35:10] - Start sampling MongoDB...
------- [ Migration number 32 finished successfully ] JFrog Xray migrations are ready -------




Installation types

 

xray-migration-readiness-darwin-386         

xray-migration-readiness-darwin-amd64        

xray-migration-readiness-linux-386           

xray-migration-readiness-linux-amd64        

xray-migration-readiness-linux-arm          

xray-migration-readiness-linux-arm64        

xray-migration-readiness-windows-386.exe    

xray-migration-readiness-windows-amd64.exe    


In case new zsh in macOS Catalina is being used, please add the following line to ~/.zshrc   unsetopt nomatch