Rotating Your Database password
Delectable Bonsai’s database security policy is to rotate the password at least every 90 days.
Here, you’ll change your database password in your production environment.
Changing database credentials requires a period of scheduled downtime for live production environments, because your environment’s services must restart.
Creating a Manual Backup
Before you change any database credentials, create a manual backup so that you can restore it after the update.
-
In the Liferay Cloud console, navigate to your production environment.
-
Click Backups.
-
On the Backups page, click Backup Now.
The backup service’s controls are temporarily unavailable while a backup is created. Wait for the backup to finish before proceeding.
Do not skip this step! You must create a backup before proceeding. Changing the database password requires deleting and recreating the database service, and then restoring your data. If you do not create a backup first, you will lose all your data.
Changing Your Database Password
Next, change the database password.
-
Click Settings on the left side of the screen.
-
On the Settings screen, select the Secrets tab.
-
Click the row for the
lcp-secret-database-password
secret. -
Click Edit at the top-right corner of the screen.
-
On the Edit Secrets page, under Value, click Show to reveal the secret, and change the value to a new database password.
tipOpt to use a strong password for improved security. The password does not need to be easily memorized because your environment’s administrators can retrieve it from the Secrets page when needed.
-
Check the checkboxes under Publish secret (at the bottom of the page) to acknowledge the impact of the change.
-
Click Publish Changes.
The secret value is changed, but the database service is not using the new password yet.
Deleting and Deploying the Database Service
Delete and re-deploy the database service for your new password to take effect. Be sure you have backed up your data first!
-
Click Services on the left side of the screen.
-
Click Actions ( ) for the database service, and click Delete service.
-
Click the checkboxes under Delete confirmation to acknowledge the impact of the deletion.
-
Click Delete Service.
-
Click Builds at the top of the screen.
-
Click Actions for the latest build, and click Deploy build to…
-
From the Environment drop-down menu, select your production environment.
-
Click the checkboxes under Deploy confirmation to acknowledge the impact of the deployment.
-
Click Deploy Build.
Your production environment’s services restart, and when they’re back up, they use the new database password.
Restoring the Backup
Once your services are up and running again (with the Ready
status), restore the backup you created beforehand.
-
Navigate back to your production environment in the Liferay Cloud console.
-
Click Backups on the left side of the screen.
-
Click Actions ( ) for the manual backup you created previously, and click Restore to…
-
In the Select environment drop-down menu, select your production environment.
-
Click the checkboxes to confirm the impact of the restore process.
-
Click Restore to Environment.
Your production environment’s services restart, and when they’re back up, all services that use the database use the new password.
Next: walk through the process of installing a hotfix.