Starting with Redis 6, the Access Control List feature was introduced by Redis. In specific scenarios, this change also changes how a Redis Database can be upgraded. To help describe when each upgrade method applies, we’ll use the term
pre-ACL
to describe Redis version 5 and below, and post-ACL
to describe Redis version 6 and beyond.Pre-ACL to Pre-ACL and Post-ACL to Post-ACL Upgrades
Pre-ACL to Pre-ACL and Post-ACL to Post-ACL Upgrades
Prerequisite: Install the Aptible CLI
1
Collection Configuration Information
Collect information on the Database you’d like to upgrade and store it in the following environment variables for use later in the guide:
-
DB_HANDLE
- The handle (i.e. name) of the Database. -
ENVIRONMENT
- The handle of the environment the Database belongs to. -
VERSION
- The desired Redis version. Runaptible db:versions
to see a full list of options.
2
Contact the Aptible Support Team
An Aptible team member must update the Database’s metadata to the new version in order to upgrade the Database. When contacting Aptible Support please adhere to the following rules to ensure a smooth upgrade process:
- Ensure that you have Administrator Access to the Database’s Environment. If you do not, please have someone with access contact support or CC an Account Owner or Deploy Owner for approval.
- Use the same email address that’s associated with your Aptible user account to contact support.
- Include the configuration values above. You may run the following command to generate a request with the required information:
3
Restart the Database
Once support has updated the Database version, you’ll need to restart the database to apply the upgrade. You may do so at your convenience with the
aptible db:reload
CLI command:Pre-ACL to Post-ACL Upgrades
Pre-ACL to Post-ACL Upgrades
Method 1: Use Replication to Orchestrate a Minimal-Downtime Upgrade
Method 1: Use Replication to Orchestrate a Minimal-Downtime Upgrade
Prerequisite: Install the Aptible CLI and Redis CLI
1
Collect Configuration Information
Step 1: ConfigurationCollect information on the Database you’d like to upgrade and store it in the following environment variables in a terminal session for use later in the guide:Collect information for the new Database and store it in the following environment variables:
-
OLD_HANDLE
- The handle (i.e. name) of the Database. -
ENVIRONMENT
- The handle of the Environment the Database belongs to.
-
NEW_HANDLE
- The handle (i.e., name) for the Database. -
NEW_VERSION
- The desired Redis version. Runaptible db:versions
to see a full list of options. Note that there are different “flavors” of Redis for each version. Double-check that the new version has the same flavor as the original database’s version. -
NEW_CONTAINER_SIZE
(Optional) - The size of the new Database’s container in MB. You likely want this value to be the same as the original database’s container size. See the Database Scaling documentation for a full list of supported container sizes. -
NEW_DISK_SIZE
(Optional) - The size of the new Database’s disk in GB. You likely want this value to be the same as the original database’s disk size.
2
Provision the new Database
Create the new Database using
aptible db:create
.Example:3
Tunnel into the new Database
In a separate terminal, create a Database Tunnel to the new Database using the The tunnel will block the current terminal until it’s stopped. Collect the tunnel’s full URL, which is printed by aptible db:tunnel, and store it in the
aptible db:tunnel
command.Example:NEW_URL
environment variable in the original terminal.Example:4
Retrieve the Old Database's Database Credentials
To initialize replication, you’ll need the Database Credentials of the old database. We’ll refer to these values as the following:
-
OLD_HOST
-
OLD_PORT
-
OLD_PASSWORD
5
Connect to the New Database
Using the Redis CLI in the original terminal, connect to the new database:
6
Initialize Replication
Using the variables from Step 4, run the following commands on the new database to initialize replication.
7
Cutover to the New Database
When you’re ready to cutover, point your Apps to the new Database and run
REPLICAOF NO ONE
via the Redis CLI to stop replication. Finally, deprovision the old database using the command aptible db:deprovision.Method 2: Dump and Restore to a new Redis Database
Method 2: Dump and Restore to a new Redis Database
We recommend Method 1 above, but you can also dump and restore to upgrade if you’d like. This method introduces extra downtime, as you must take your database offline before conducting the dump to prevent new writes and data loss.
1
Collection Configuration Information
Collect information on the Database you’d like to upgrade and store it in the following environment variables in a terminal session for use later in the guide:Collect information for the new Database and store it in the following environment variables:
-
OLD_HANDLE
- The handle (i.e. name) of the Database. -
ENVIRONMENT
- The handle of the Environment the Database belongs to
-
NEW_HANDLE
- The handle (i.e., name) for the Database. -
NEW_VERSION
- The desired Redis version. Runaptible db:versions
to see a full list of options. Note that there are different “flavors” of Redis for each version. Double-check that the new version has the same flavor as the original database’s version. -
NEW_CONTAINER_SIZE
(Optional) - The size of the new Database’s container in MB. You likely want this value to be the same as the original database’s container size. See the Database Scaling documentation for a full list of supported container sizes. -
NEW_DISK_SIZE
(Optional) - The size of the new Database’s disk in GB. You likely want this value to be the same as the original database’s disk size.
2
Provision the New Database
Create the new Database using
aptible db:create
.Example:3
Tunnel into the Old Database
In a separate terminal, create a Database Tunnel to the old Database using the The tunnel will block the current terminal until it’s stopped. Collect the tunnel’s full URL, which is printed by
aptible db:tunnel
command.Example:aptible db:tunnel
, and store it in the OLD_URL
environment variable in the original terminal.Example:4
Dump the Old Database
Dump the old database to a file locally using rdb and the Redis CLI.Example:
5
Tunnel into the New Database
In a separate terminal, create a Database Tunnel to the new Database using the
aptible db:tunnel
command, and save the Connection URL as NEW_URL
.6
Restore the Redis Dump using rdb
Using the rdb tool, restore the dump to the new Database.
7
Cutover to the New Database
Point your Apps and other resources to your new database and deprovision the old database using the command
aptible db:deprovision
.