Tutorial
Redis Open Source to Redis Cloud
February 27, 20263 minute read
TL;DR:Export an RDB snapshot from your self-hosted Redis instance and import it into Redis Cloud (offline), or use theREPLICAOFcommand to replicate data in real time for a zero-downtime migration (live).
#What you'll learn
- How to choose between offline and live migration strategies
- How to import data into Redis Cloud from a self-hosted Redis server
- How to use
REPLICAOFfor live replication with minimal downtime - How to validate your migration and cut over traffic
#Prerequisites
- A running self-hosted Redis Open Source instance with network accessibility
- A Redis Cloud account with a target database created
- Access to the Redis Cloud console
- For live migration: the source Redis instance must be reachable from the Redis Cloud service
Before migrating to Redis Cloud, you should evaluate the migration and consider the best option. Read this guide to determine which migration strategy is right for you.
#Why migrate to Redis Cloud?
Redis Cloud is a fully managed service that handles provisioning, patching, monitoring, and scaling so you can focus on your application instead of infrastructure. Key benefits include built-in high availability with automatic failover, instant scalability, and enterprise-grade security. Redis Cloud also offers a free tier so you can test your workload before committing.
#Offline data migration
Offline migration works best when you can tolerate a brief maintenance window. You export your dataset and import it directly into Redis Cloud.
To import a dataset from any publicly available Redis server:
- Select Databases from the Redis Cloud console menu and then select the target database from the database list.
- Select Import.
- Enter the source database details:
- Source type - Select Redis.
- Redis Hostname/IP Address - Enter the hostname or the public IP address of the source Redis server.
- Redis port - Enter the port of the source Redis server if it is not the default value of 6379.
- Password - Enter the password, if required by the source Redis database.
- Select Import.
- Validate your migration and redirect your application's traffic to the new Redis Cloud endpoint.
References:
#Live data migration
Live migration uses Redis replication to sync data continuously, allowing you to cut over with minimal downtime.
- Connect to your Redis Cloud Database
- Use REPLICAOF command to replicate the database
3. Use the REPLICAOF command with the NO ONE option to stop replication.
4. Validate your migration and redirect your application's traffic to the new Redis Cloud endpoint.
References:
#Is there downtime during migration?
With offline migration, there is a brief maintenance window while the import runs. Writes to the source instance during this window are not captured, so you should stop writes before exporting.
With live migration using
REPLICAOF, data is replicated continuously. You can cut over traffic once the replica is fully synchronized, resulting in near-zero downtime. Monitor replication lag with the INFO replication command on the target to confirm the replica is up to date before switching.#Next steps
- Validate your data after migration to confirm key counts and sample values match
- Configure your application to point to the new Redis Cloud endpoint
- Explore Redis Cloud features such as Active-Active geo-distribution, auto-scaling, and advanced monitoring