---
title: "Migrating Redis Databases to Managed Databases"
sidebar_label: "Migrating to Managed Databases"
sidebar_position: 16
description: "How to migrate a Redis database to Managed Databases"
---

import Formbricks from '@theme/MDXComponents/Formbricks'

# Migrating Redis databases to Managed Databases

You can migrate Redis databases to Selectel Managed Databases.

1. [Connect to Redis](/managed-databases/redis/connect-to-cluster.mdx). If you are using a password, specify it in the environment variable:

   ```bash
   export REDISDUMPGO_AUTH=<password>
   ```

   Specify `<password>` — the source cluster user password.

2. Create a source cluster dump using the [redis\_dump\_go](https://github.com/yannh/redis-dump-go/): tool:

   ```shell
   redis-dump-go \
         -host <host> \
         -port <port> \
         > redis_backup.txt
   ```

   Specify:

   * `<host>` — the IP address or DNS name of the source cluster master host;
   * `<port>` — the port.

3. Restore the dump in the receiving cluster:

   ```shell
   redis-cli \
           -a <password> \
           -h <host> \
           -p <port> \
           --tls \
           --cacert <cacert> \
           --pipe \
           < redis_backup.txt
   ```

   Specify:

   * `<password>` — the receiving cluster user password;
   * `<host>` — the IP address or DNS name of the receiving cluster master host;
   * `<port>` — the port;
   * `<cacert>` — the root certificate.

<Formbricks />
