> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These are the docs for Sevalla, a platform for deploying applications, databases, static sites, object storage and load balancers. The dashboard is at https://app.sevalla.com.
> Bold text in steps is an exact dashboard label.
> To act on a Sevalla account, prefer the Sevalla MCP server (https://mcp.sevalla.com/mcp, see https://docs.sevalla.com/ai-agents/overview.md), then the Sevalla CLI (https://docs.sevalla.com/developer-tools/cli.md), then the REST API (https://api-docs.sevalla.com, OpenAPI spec at https://api.sevalla.com/v3/openapi.json).
> Every page index is at https://docs.sevalla.com/llms.txt.

# Import and export Valkey

> Export a Sevalla Valkey database to an RDB file with valkey-cli and import an RDB file from Valkey or Redis into one with RedisShake over the external connection.

You export a Sevalla Valkey database to an RDB file with `valkey-cli --rdb`, and import an RDB file with [RedisShake](https://github.com/tair-opensource/RedisShake), which replays its keys into the running database. Both work over the database's [external connection](https://docs.sevalla.com/databases/connect.md#enable-the-external-connection). Valkey speaks the Redis protocol, so the same steps move data from Redis to Valkey. Sevalla uses RedisShake for its own Valkey restores too.

## Before you begin

* Create the database on Sevalla first, on the same Valkey version as the source or a newer one. See [Create a database](https://docs.sevalla.com/databases/create.md).
* [Enable the external connection](https://docs.sevalla.com/databases/connect.md#enable-the-external-connection). If [IP restrictions](https://docs.sevalla.com/databases/connect.md#restrict-access-by-ip-address) are on, allow your IP address.
* To export, install `valkey-cli` at the database's major version or newer: on macOS `brew install valkey`, elsewhere see [valkey.io/download](https://valkey.io/download/). `redis-cli` also works.
* To import, download RedisShake 4.6 or later for your system from its [releases](https://github.com/tair-opensource/RedisShake/releases) and unpack it.
* Copy the **Host**, **Port** and **Password** from the database's **Overview** tab, under **Connection** > **External**. See [Find the connection details](https://docs.sevalla.com/databases/connect.md#find-the-connection-details).
* With [TLS](https://docs.sevalla.com/databases/connect.md#encrypt-connections-with-tls) on, the external connection accepts only TLS: on the **Networking** tab, click **Download CA certificate** and save the file next to where you run the commands.

The examples use the host `orders-db-k3j4h.ext.sevalla.app`, port `20145` and CA certificate `orders-db-k3j4h-ca.crt`; replace them, and `<password>`, with yours. For a database without TLS, leave out `--tls` and `--cacert`.

## Export a database

```bash theme={"theme":{"light":"github-dark-default","dark":"github-dark-default"}}
REDISCLI_AUTH='<password>' valkey-cli -h orders-db-k3j4h.ext.sevalla.app -p 20145 --tls --cacert orders-db-k3j4h-ca.crt --rdb orders-cache.rdb
```

`valkey-cli` asks the server for a point-in-time snapshot over the replication protocol and writes it to `orders-cache.rdb`. The file holds every logical database (`db0`, `db1` and so on). While the snapshot is taken, the server forks as it does for a background save, so its memory use rises briefly. `valkey-cli` 7.2 and 8.1 read the password only from `REDISCLI_AUTH`; 9.0 also reads `VALKEYCLI_AUTH`.

## Import a database

**1. Write the configuration**

Save this as `shake.toml` next to the `redis-shake` binary, with the path to your RDB file and the Sevalla database's external host, port and password:

```toml shake.toml theme={"theme":{"light":"github-dark-default","dark":"github-dark-default"}}
[rdb_reader]
filepath = "/Users/you/orders-cache.rdb"

[redis_writer]
cluster = false
address = "orders-db-k3j4h.ext.sevalla.app:20145"
username = ""
password = "<password>"
tls = true
```

RedisShake encrypts the connection with `tls = true` but doesn't verify the server's certificate. For a database without [TLS](https://docs.sevalla.com/databases/connect.md#encrypt-connections-with-tls), set `tls = false`.

**2. Run RedisShake**

```bash theme={"theme":{"light":"github-dark-default","dark":"github-dark-default"}}
./redis-shake shake.toml
```

RedisShake reads the file and writes each key, in its logical database, to the Sevalla database, then exits.

**3. Check the keys**

Open the database's **Redis studio** tab and look through the **Keys** page, or count the keys:

```bash theme={"theme":{"light":"github-dark-default","dark":"github-dark-default"}}
REDISCLI_AUTH='<password>' valkey-cli -h orders-db-k3j4h.ext.sevalla.app -p 20145 --tls --cacert orders-db-k3j4h-ca.crt DBSIZE
```

Import into an empty database. By default RedisShake stops at the first key that already exists in the database. To overwrite existing keys, add `rdb_restore_command_behavior = "rewrite"` under an `[advanced]` section of `shake.toml`; to keep them, use `"skip"`.

## Restore a dump backup

Databases in OCI locations write their [dump backups](https://docs.sevalla.com/databases/backups.md#external-backups-on-oci) as gzip-compressed RDB files. [Download one](https://docs.sevalla.com/databases/backups.md#download-a-dump-backup), unpack it, and import it with RedisShake as in [Import a database](#import-a-database):

```bash theme={"theme":{"light":"github-dark-default","dark":"github-dark-default"}}
gunzip 20261018-000000_automatic_valkey9.0_orders-cache-backups.rdb.gz
```

To restore a Sevalla backup into a Sevalla database, use **Restore** on the **Backups** tab instead; it empties every logical database first. See [Restore a backup](https://docs.sevalla.com/databases/backups.md#restore-a-backup).

## Common errors

| Error | Fix |
| - | - |
| `NOAUTH Authentication required.` | The password wasn't sent. Set `REDISCLI_AUTH`, or set `password` in `shake.toml`. |
| `WRONGPASS invalid username-password pair or user is disabled.` | The password is wrong. Copy it again from the dashboard; if you [changed it](https://docs.sevalla.com/databases/connect.md#change-the-database-password), use the new one. |
| `Could not connect to Valkey at ...` | Check the external connection is on and the host and port match the dashboard. See [Troubleshoot databases](https://docs.sevalla.com/databases/troubleshooting.md). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.