ARTIFACTORY: Artifactory version 7 upgrade and rollback (Linux Archive installation)

Manuchandran P
2023-03-05 10:16

This guide includes a description of how to Artifactory version 7.x upgrade using Linux archive installation method and rollback the Artifactory to the previous 7.x version.

If an Artifactory upgrade fails and we need to perform a rollback to the previous Artifactory version to ensure service up and running. Before upgrading to a new version of Artifactory it is a prerequisite to have the DB backup and Artifactory home folder backup.

In this article, we will demonstrate using the
Artifactory version 7.31.10 with Postgres 13 as the external DB and the default filestore. Then we will be upgrading it to 7.49.8,

Create a directory for Artifactory home and download the Artifactory binary files.mkdir /opt/jfrog
cd /opt/jfrog
wget https://releases.jfrog.io/artifactory/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/7.31.10/jfrog-artifactory-pro-7.31.10-linux.tar.gz
tar -xvf jfrog-artifactory-pro-7.31.10-linux.tar.gz

Rename to “artifactory”mv artifactory-pro-7.31.10 artifactory
Set JFrog homeexport JFROG_HOME=/opt/jfrog
Go to /opt/jfrog/artifactory/app/bin and execute Artifactory install script. This will install Artifactory as a service./installService.sh
Start the Artifactorysystemctl start artifactory.service
Edit system.yaml and add the DB according to our requirements.
Restart the Artifactory and Verify the Artifactory status

Next, we will be upgrading to the latest 7.x version of Artifactory. As the first step, we need to stop the currently running Artifactory service.

 Shut down your Artifactory service:systemctl stop artifactory
Take the backup of Jfrog home directorycp -R /opt/jfrog /opt/jfrog-back
Take the backup of DBpg_dump <DB NAME> > DB NAME.back
Create another directory under opt to extract the 7.49.x version Artifactory.mkdir /opt/jfrog1
cd /opt/jfrog1
wget https://releases.jfrog.io/artifactory/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/7.49.8/jfrog-artifactory-pro-7.49.8-linux.tar.gz
tar -xvf jfrog-artifactory-pro-7.49.8-linux.tar.gz 

Remove the app directory from Artifactory 7.31.10 home folder rm -rf /opt/jfrog/artifactory/app
Replace with Artifactory version 7.49.8 app directorycp -R /opt/jfrog1/artifactory-pro-7.49.8/app /opt/jfrog/artifactory/
Change ownership to Artifactory for newly copied app directory chown -R artifactory:artifactory /opt/jfrog
Start the Artifactorysystemctl start artifactory
Verify the version and data2023-03-01T07:36:45.440Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [.BasicConfigurationManager:186] [Catalina-utility-1  ] - Artifactory (jfrt) service initialization started. Version: 7.49.7 Revision: 74907900 PID: 17450 Home: /opt/jfrog/artifactory
2023-03-01T07:36:45.593Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:212] [Catalina-utility-1  ] - Triggering PRE_INIT conversion, from 7.31.10 to 7.49.7
2023-03-01T07:36:45.594Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:215] [Catalina-utility-1  ] - Finished PRE_INIT conversion, current version is: 7.49.7
2023-03-01T07:36:52.249Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:212] [Catalina-utility-1  ] - Triggering MARKERS conversion, from 7.31.10 to 7.49.7
2023-03-01T07:36:52.298Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:215] [Catalina-utility-1  ] - Finished MARKERS conversion, current version is: 7.49.7
2023-03-01T07:36:52.299Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:212] [Catalina-utility-1  ] - Triggering HOME_FILES conversion, from 7.31.10 to 7.49.7
2023-03-01T07:36:52.584Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:215] [Catalina-utility-1  ] - Finished HOME_FILES conversion, current version is: 7.49.7
2023-03-01T07:36:52.690Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:212] [Catalina-utility-1  ] - Triggering HOME_SYNC_FILES conversion, from 7.31.10 to 7.49.7
2023-03-01T07:36:52.748Z [jfrt ] [INFO ] [b7168cb41adc7c5 ] [d.c.m.ConverterManagerImpl:215] [Catalina-utility-1  ] - Finished HOME_SYNC_FILES conversion, current version is: 7.49.7
 Version:  7.49.7                                  __/ |
 Product Version:  7.49.8

Note: At the time of this writing, the latest version of Artifactory was 7.49.8. However, the same steps still hold good for any Artifactory 7.x version (Linux Archive installation) rollback.

If for any reason we would like to rollback to the previous version of Artifactory. We will follow the below steps.
Rollback to the previous version. 
 
 Shut down your Artifactory service:systemctl stop artifactory
Create a new db and restore data from the DB dump captured before upgrading to the latest version.psql -U artifactory <new DB name> < DB NAME.back
Rename latest version Artifactory home folder to different name mv /opt/jfrog /opt/jfrog-7.49.8
Replace backed up old version Artifactory home folder mv /opt/jfrog-back /opt/jfrog
Edit the system.yaml file to point to new DB
Start the Artifactorysystemctl start artifactory
Verify the version and data2023-03-01T07:12:55.725Z [jfrt ] [INFO ] [f76c52c9e37e464d] [d.c.m.ConverterManagerImpl:212] [ocalhost-startStop-2] - Triggering PRE_INIT conversion, from 7.31.10 to 7.31.10
2023-03-01T07:12:55.726Z [jfrt ] [INFO ] [f76c52c9e37e464d] [d.c.m.ConverterManagerImpl:215] [ocalhost-startStop-2] - Finished PRE_INIT conversion, current version is: 7.31.10
 Version:  7.31.10                                 __/ |
 Artifactory Home: '/opt/jfrog/artifactory'