Service Instance Migration
This document describes how to migrate data from an older a9s Redis®[^*] version to a newer one. We present two
approaches, the first one uses the MIGRATE command, while the other one performs an element-wise DUMP & RESTORE.
The following migration paths have been tested and are supported by the a9s Data Services Framework:
- a9s Redis® 6 -> a9s Redis® 7 GA
- a9s Redis® 7 RC -> a9s Redis® 7 GA (Special Case)
Please be aware that a difference exists between Redis® 7 RC and Redis® 7 GA due to the implementation of Redis® ACL in Redis® 7 GA. This results in a minor alteration in the migration process. This discrepancy will be highlighted during the subsequent steps.
Prerequisites
- Install redis-cli.
Known Issues
See the Known Issues page for further details.
Before Migrating
It is highly recommended to isolate the Redis® Service Instance before starting the migration. This avoids potential data inconsistencies that could be caused if the Redis® Service Instance is receiving new data while processing the migration at the same time.
Isolating The Nodes Before The Migration
Overall the goal is to avoid client connections. That way, we ensure that we are not writing data into the a9s Redis® Service Instance during the migration process.
This can be achieved by unbinding all applications from your Redis® Service Instance.
We recommend saving your Service Instance's RDB file as failsafe in the event of unexpected data loss. This file must be stored safely, at least until the consistency of the database has been confirmed, post-migration.
You can download the latest backup from a9s Service Dashboard.
Details
Save the RDB File (Alternative)
Alternatively, it is possible to download the RDB file for a specific Service Instance usingredis-cli:# set `tls` value if the Origin Service Instance is SSL
# origin_tls="--tls --cacert <origin_ca_cert_path>"
redis-cli --user <a9s-redis-origin-username> -h <a9s-redis-origin-host> -p 6379 \
-a <a9s-redis-origin-password> ${origin_tls:-} --rdb /tmp/dump.rdb
a9s Redis® 7 RC and below
# set `tls` value if the Origin Service Instance is SSL
# origin_tls="--tls --cacert <origin_ca_cert_path>"
redis-cli -h <a9s-redis-origin-host> -p 6379 -a <a9s-redis-origin-password> ${origin_tls:-} \
--rdb /tmp/dump.rdb
- For a9s Redis® 7 GA version or newer, this alternative does not work.
Please refer to the Placeholder Values table at the end of this guide for further details on <a9s-redis-origin-host>,
<a9s-redis-origin-username>, <a9s-redis-origin-password>, <origin_ca_cert_path> and similar placeholders on this
document.
Create New a9s Redis® destination Instance
Create a new and empty a9s Redis® destination Service Instance that will be the target for the data migration from an existing Redis® origin Service Instance.
- Do not insert any data inside of the machine before the migration and checking are done.
- Create a Service Instance with the same capabilities or greater.
Reverse Tunnel
The goal is to give access to the Application Developer to the Redis® Service Instance. And for this, it is necessary to make a SSH tunnels to the Redis® origin Service Instance.
In the end, we want to achieve the following scenario below.
(port 6379) (port 6379)
/----> * Redis® Origin * ----- Redis® MIGRATE -----> * Redis® Destination *
/
* CF Application * (via SSH Tunnel) [infrastructure network]
--------/-----------------------------------------------------------------
/ [Developer network]
* Developer Machine * (local port 6379)