VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-migrate-redis-data-to-a-digitalocean-managed-database

⇱ How To Migrate Redis Data to a DigitalOcean Managed Database | DigitalOcean


How To Migrate Redis Data to a DigitalOcean Managed Database

Updated on August 17, 2020

By Mark Drake

Manager, Developer Education

English
👁 How To Migrate Redis Data to a DigitalOcean Managed Database

Introduction

When looking to migrate data from one Redis instance to another, there are a number of methods one could employ, such as replication or snapshotting. However, migrations can get more complicated when you’re moving data to a Redis instance managed by a cloud provider, as managed databases often limit how much control you have over the database’s configuration.

This tutorial outlines one method you can use to migrate data to a Redis instance managed by DigitalOcean. The method involves creating a Bash script that uses Redis’s internal migrate command to securely pass data through a TLS tunnel configured with stunnel. This guide will also go over a few other commonly-used migration strategies and why they’re problematic when migrating to a DigitalOcean Managed Database.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

👁 Mark Drake
Mark Drake
Author
Manager, Developer Education
See author profile

Former Technical Writer at DigitalOcean. Focused on SysAdmin topics including Debian 11, Ubuntu 22.04, Ubuntu 20.04, Databases, SQL and PostgreSQL.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

I struggled with the migration script at first because all of my keys weren’t included in scan 0 I found I could add count onto the end that is greater than my number of keys to get it to iterate through everything.

redis-cli -n source_database -a source_password scan 0 count 2500

Also redis 4.0.7 is the minimum version to support authentication with the MIGRATE command.

Thanks for the article!

It worked well for me in a staging test with ~30,000 keys, but unfortunately there seems to be an upper-limit to the amount of keys this can migrate.

I tried it on a server with ~130,000 keys and the script never output anything, only hung and then back to prompt. In the meantime, the redis-server in the background hung / crashed / rebooted but with no data loss.

Does this actually work anymore? I saw in another thread that we can’t use redis-cli because it does not support TLS. And it says to use redli which does connect correctly.

But this entire document is about redis-cli, which can’t connect to your managed redis database.

What if I’m migrating a Redis Docker container? Will it work to install stunnel on the Docker host?

👁 Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.