**TL;DR:** Migrating from self-hosted Redis to Upstash: export and import, then fix TLS, auth, eviction, and blocking-command assumptions. Move the data Export from self-hosted (RDB snapshot or MIGRATE/DUMP per key) and import into Upstash. Test the export/import on a scratch database first and compare key counts.

# Migrating from self-hosted Redis to Upstash

## 1. Move the data

Export from self-hosted (RDB snapshot or MIGRATE/DUMP per key) and
import into Upstash. There is no live-replication intake: plan a
cutover window. Test the export/import on a scratch database first
and compare key counts.

## 2. Fix the connection layer

- TLS: Upstash requires it. Add TLS to every client config.
- Auth: replace your password with the Upstash console token.
- URLs: replace host/port with the Upstash endpoint and port.
- No CLUSTER: if your client runs in cluster mode, switch it to
  standalone.

## 3. Audit command usage

- Blocking commands (BLPOP, BRPOP, blocking XREAD) work over the
  native protocol but NOT over REST. If you are also moving to
  serverless, rewrite consumers as pollers or keep them on RESP.
- Check the compatibility notes: Upstash tracks Redis protocol up
  to 8.4 with its own SEARCH and VECTOR command families.
- WATCH/UNWATCH/DISCARD are not supported over REST transactions.
  Use /multi-exec semantics or Lua.

## 4. Rethink persistence and eviction

Self-hosted Redis often runs with noeviction and RDB/AOF tuned by
hand. On Upstash, check the data-size limit of your tier and set an
eviction policy that matches: cache workloads want TTLs plus an
eviction policy, durable workloads want no silent eviction.

## 5. Cut over

Dual-write during the window if you can, then flip reads, then
stop the old writes. Verify key counts and spot-check values
before decommissioning.

## Verify

Key count matches, TTLs preserved, app tests pass against Upstash,
and the old instance shows zero traffic before you shut it down.

## When to use this

- This covers exactly what the title says: Migrating from self-hosted Redis to Upstash.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.

## When not to use this

- You are doing a different workflow with Migrating; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.

## Compatibility

- Mentions 8.4 in the original; behavior may differ on much older or newer releases.