Importing data from an external Redis database

This tutorial aims at transferring all the data from a remote Redis database (from another provider) to a Redis instance provisioned through the Scalingo Redis Addon.


The remote Redis instance should be accessible on the Internet, and you could connect with:

$ redis-cli -a <password> -h <host> -p <port>

Create a redis-console on Scalingo

Thanks to the redis-console utility of the scalingo command, create a console to your Redis addon:

$ scalingo -a my-app redis-console
-----> Connecting to container [one-off-5541]...
-----> Process 'redis-console' is starting...

---> Download and extract the database CLI
---> Database CLI installed: redis-cli 4.0.8
[host:port] >

Copy data from the remote Redis instance

You need to own the source Redis connection information in order to copy its content. Let’s consider the following example:

  • Host:
  • Port: 10189
  • Password: pfe8060d30f6059b98a7ce7d

The following method configures temporarily the Redis instance hosted on Scalingo to be become a slave of the remote your want to copy the content from. Once the operation will be over, the replication link will be disabled, all the keys and values will have been transfered.

Back in the redis-console:

[host:port] > CONFIG SET masterauth pfe8060d30f6059b98a7ce7d
[host:port] > SLAVEOF 10189

At that point, the replication process has started, its duration is relative to the amount of data contained by the remote database, it’s usually a matter of seconds. To check if the process is over, look at the INFO command:

[host:port] > INFO replication
# Replication

Once the master_sync_in_progress value becomes 0, it means the data synchronization is over.

Restore configuration

Once the synchronization is over, you need to disable the replication configuration:

[host:port] > SLAVEOF NO ONE

That’s it, your Redis instance, owns all the data of your remote Redis, and is ready to accept queries from your application.

Suggest edits

Importing data from an external Redis database

©2022 Scalingo