> ## Documentation Index
> Fetch the complete documentation index at: https://cache-pot.thatdevguy.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Redis to Cache-Pot without changing code

> Cache-Pot speaks RESP2 and supports the same core commands as Redis. Point your existing Redis client at Cache-Pot and it works immediately.

Cache-Pot is a drop-in Redis replacement for most use cases. It speaks RESP2 over the wire, so any Redis client library — ioredis, redis-py, go-redis, Lettuce, Jedis — connects and works without a single line of code changing. For the vast majority of apps that use Redis as a cache or key/value store, pointing the connection string at Cache-Pot is all you need to do.

## What's compatible

Cache-Pot implements all the command groups you rely on day-to-day:

<CardGroup cols={3}>
  <Card title="Strings" icon="font">
    `GET`, `SET`, `MGET`, `MSET`, `INCR`, `APPEND`, `GETRANGE`, and more
  </Card>

  <Card title="Hashes" icon="table-cells">
    `HSET`, `HGET`, `HGETALL`, `HDEL`, `HMGET`, `HKEYS`, `HVALS`, `HLEN`
  </Card>

  <Card title="Lists" icon="list">
    `LPUSH`, `RPUSH`, `LPOP`, `RPOP`, `LRANGE`, `LLEN`, `LINDEX`
  </Card>

  <Card title="Sets" icon="layer-group">
    `SADD`, `SREM`, `SMEMBERS`, `SISMEMBER`, `SCARD`
  </Card>

  <Card title="Sorted Sets" icon="arrow-up-9-1">
    `ZADD`, `ZREM`, `ZSCORE`, `ZRANGE`, `ZRANGEBYSCORE`, `ZCARD`
  </Card>

  <Card title="Pub/Sub" icon="tower-broadcast">
    `SUBSCRIBE`, `UNSUBSCRIBE`, `PSUBSCRIBE`, `PUNSUBSCRIBE`, `PUBLISH`
  </Card>

  <Card title="Transactions" icon="arrow-right-arrow-left">
    `MULTI`, `EXEC`, `DISCARD`, `WATCH`, `UNWATCH`
  </Card>

  <Card title="Key Expiry" icon="clock">
    `EXPIRE`, `PEXPIRE`, `EXPIREAT`, `TTL`, `PTTL`, `PERSIST`
  </Card>

  <Card title="Iteration" icon="rotate">
    `SCAN`, `HSCAN`, `SSCAN`, `ZSCAN` with `MATCH` and `COUNT`
  </Card>

  <Card title="Auth & Select" icon="key">
    `AUTH`, `SELECT 0`, `PING`, `QUIT`, `ECHO`
  </Card>

  <Card title="Server" icon="server">
    `INFO`, `DBSIZE`, `FLUSHDB`, `SAVE`, `BGSAVE`, `BGREWRITEAOF`
  </Card>

  <Card title="Observability" icon="chart-line">
    `MONITOR`, `SLOWLOG`, `CLIENT LIST`, `CONFIG GET/SET`
  </Card>
</CardGroup>

## What's different

Cache-Pot is honest about where it diverges from Redis. These differences only matter if your current setup uses the specific features listed below.

<Note>
  If you use Redis purely as a cache or key/value store, none of these differences will affect you.
</Note>

| Feature                         | Redis                          | Cache-Pot                                                                      |
| ------------------------------- | ------------------------------ | ------------------------------------------------------------------------------ |
| Multiple databases              | `SELECT 0` through `SELECT 15` | `SELECT 0` only — `SELECT 1+` returns an error                                 |
| Clustering & replication        | Full support                   | Single-node only in v1                                                         |
| Protocol version                | RESP2 and RESP3                | RESP2 only                                                                     |
| RedisSearch / RedisJSON modules | Available as add-ons           | Not available — Cache-Pot has its own `VSET`/`VSEARCH` and `SCACHE.*` commands |

<Warning>
  If your application calls `SELECT` with a database index greater than `0`, it will receive an error. Audit your codebase for `SELECT` usage before switching.
</Warning>

## Migration steps

<Steps>
  <Step title="Install Cache-Pot">
    Install via Go, Docker, or build from source:

    <CodeGroup>
      ```bash Go theme={null}
      go install github.com/subh05sus/cache-pot/cmd/cache-pot@latest
      cache-pot
      ```

      ```bash Docker theme={null}
      docker run -p 6379:6379 -p 8080:8080 ghcr.io/subh05sus/cache-pot:latest
      ```

      ```bash Source theme={null}
      git clone https://github.com/subh05sus/cache-pot
      cd cache-pot
      go run ./cmd/cache-pot
      ```
    </CodeGroup>

    Cache-Pot starts listening on `:6379` by default — the same port Redis uses.
  </Step>

  <Step title="Export your data from Redis (if you need it)">
    Cache-Pot uses its own snapshot format, not Redis's RDB format. If you have data in Redis that needs to carry over, export it using `redis-cli` and replay the writes:

    ```bash theme={null}
    # Dump a snapshot from your existing Redis instance
    redis-cli --rdb dump.rdb

    # Cache-Pot cannot load RDB files directly.
    # Replay key writes using a script or redis-cli --pipe against Cache-Pot.
    ```

    <Info>
      For a fresh start or when migrating only the connection (not the data), skip this step entirely.
    </Info>
  </Step>

  <Step title="Update your connection string">
    Point your application at Cache-Pot. If Cache-Pot is running locally on the default port, your connection string likely does not need to change at all:

    ```bash theme={null}
    # Most apps read this from an environment variable
    export REDIS_URL=redis://localhost:6379
    ```
  </Step>

  <Step title="Configure authentication (if you use AUTH)">
    If your Redis instance requires a password, start Cache-Pot with the same password using `--auth` or the `CACHEPOT_AUTH` environment variable:

    ```bash theme={null}
    cache-pot --auth mysecretpassword

    # Or via environment variable
    CACHEPOT_AUTH=mysecretpassword cache-pot
    ```
  </Step>

  <Step title="Verify the connection">
    Confirm everything is working by connecting and running `PING`:

    ```bash theme={null}
    redis-cli -p 6379 PING
    # Expected: PONG

    redis-cli -p 6379 SET hello world
    redis-cli -p 6379 GET hello
    # Expected: "world"
    ```
  </Step>
</Steps>

## Client library examples

No code changes are required — only the server address changes (and only if Cache-Pot is on a different host).

<Tabs>
  <Tab title="Node.js (ioredis)">
    ```js theme={null}
    // Before: Redis
    const Redis = require('ioredis');
    const client = new Redis('redis://localhost:6379');

    // After: Cache-Pot (no code change needed)
    const client = new Redis('redis://localhost:6379'); // same!

    // Everything works as before
    await client.set('hello', 'world');
    const value = await client.get('hello');
    console.log(value); // "world"
    ```
  </Tab>

  <Tab title="Python (redis-py)">
    ```python theme={null}
    # Before: Redis
    import redis
    r = redis.Redis(host='localhost', port=6379)

    # After: Cache-Pot (no code change needed)
    r = redis.Redis(host='localhost', port=6379)  # same!

    # Everything works as before
    r.set('hello', 'world')
    print(r.get('hello'))  # b'world'
    ```
  </Tab>

  <Tab title="Go (go-redis)">
    ```go theme={null}
    // Before: Redis
    rdb := redis.NewClient(&redis.Options{Addr: "localhost:6379"})

    // After: Cache-Pot (no code change needed)
    rdb := redis.NewClient(&redis.Options{Addr: "localhost:6379"}) // same!

    // Everything works as before
    err := rdb.Set(ctx, "hello", "world", 0).Err()
    val, err := rdb.Get(ctx, "hello").Result()
    fmt.Println(val) // "world"
    ```
  </Tab>
</Tabs>

<Tip>
  Once you have migrated, explore Cache-Pot's AI extensions. Vector search (`VSET` / `VSEARCH`) and semantic caching (`SCACHE.SET` / `SCACHE.GET`) are available with no additional setup — except an embedding endpoint for the semantic cache. They run through the same RESP2 connection your existing client already holds.
</Tip>
