Changing Your Database Password

Changing the database password for your database service also affects the other services that must connect to the database.

Warning

Updating your database password requires a period of downtime for you to restore a backup to your database service, and then restart all of your services. Plan ahead to make time for this before rotating your database password.

Creating a Backup

If you are changing the password for a production environment, you must ensure you have an up-to-date backup so you can restore it after the update.

To create a backup for any environment, click Backups from the menu on the left:

Navigate to your chosen environment's Backups page.

Then, click Backup Now on the Backups page:

Click Backup Now to create a new backup.

Changing the Database Password

Change your database password using your chosen environment’s secrets, after you’ve created a backup.

  1. Navigate to your chosen environment.

  2. Click Settings from the menu on the left.

    Navigate to your environment's Settings page.

  3. Click the Secrets tab.

  4. Click the lcp-secret-database-password secret from the list.

  5. Click Edit at the top of the screen.

    Edit the lcp-secret-database-password secret.

  6. In the Value section, click Show beside the value to reveal the secret and enable editing.

    Show the secret to enable editing it.

  7. Edit the secret value.

  8. Scroll down and check all of the boxes acknowledging the effects of changing the value of the secret.

    Check the boxes to enable the Publish secret button.

  9. Click Publish Changes.

The services restart and the database user is updated with the new password. While the services are restarting, they do not receive requests.

Important

If your database service is not updated to version 5.1.2+, the password can only be updated after deleting and redeploying the service. Continue reading to complete the process for these versions.

Additional Required Steps (Versions Before 5.1.2)

The database password is still changed directly using your chosen environment’s secrets prior to version 5.1.2. However, you must follow additional steps to ensure that your services update correctly with the new value.

After you’ve updated the secret value, follow these steps to complete the process.

  1. Return to your environment’s Services page.

  2. From the Actions menu for the database service, click Delete Service.

    Delete the service so it can be redeployed and start up with the updated password.

  3. Open a command prompt within your local clone of the repository.

  4. Deploy the database service to your environment using the command-line interface:

    cd database
    
    lcp deploy
    
  5. If you are not already logged in, enter y at the prompt and authenticate with your browser.

  6. When prompted, enter the number corresponding to your environment:

    #      Project             Status
    1      lfrlearn-infra      Ready
    2      lfrlearn-uat        Ready
    3      lfrlearn-dev        Ready
    4      lfrlearn-prd        Ready
    
    ? Type a number (#) or project name: 2
    

    The database service starts up using the updated password. The liferay and backup services restart to reconnect to the database service with the correct password, as well.

  7. If you prepared a backup, then navigate to your chosen environment’s Backups page, and restore the backup.

Your database service is now updated with a new password, and your other services are synchronized to connect to it properly.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy