ARTIFACTORY: How to change Artifactory Database password with Zero downtime?

AuthorFullName__c
Ahmad Zeidan
articleNumber
000005506
FirstPublishedDate
2022-12-15T17:45:30Z
lastModifiedDate
2025-05-15

ARTIFACTORY: How to change Artifactory Database password with Zero downtime?

Problem Description

This article shows how the Artifactory Database password could be changed with Zero Downtime. This approach requires Artifactory in HA setup and external Database. We will create a new/temporary user in the database to guarantee uptime.

Procedure

Sample Environment details:

Artifactory HA
Artifactory database: "artdb"
Artifactory database user: "artuser"


1) Create a new user called "newuser" with password “newpassword” and provide the permissions on the "artdb" database:
 

CREATE USER newuser WITH PASSWORD 'newpassword';
GRANT ALL PRIVILEGES ON DATABASE artdb TO newuser;


2) Edit the system.yaml file for all of the nodes to connect to "artdb" with "newuser":

shared:
    database:
        type: postgresql
        driver: org.postgresql.Driver
        url: jdbc:postgresql://db:5432/artdb
        username: newuser
        password: newpassword


3) Perform a rolling restart of the cluster for changes to take effect



Now all of the nodes are connected to the DB using "newuser"

*Note. Following this procedure will change the database password with zero down time, but we also changed the name of the database user, so if you have any thing configured in that name you have to change it, or you’d have to do this procedure one more time and go back to the original username but with the new password.