Skip to content
zefıly
← All posts

Redis to Valkey on Ubuntu 26.04: the dump file does not load

4 min read

Ubuntu 26.04 ships Redis 8.0 and Valkey 9.0. We tried three ways to move data from one to the other and all three failed with clear errors. What works instead, when the move is trivial, and what to check in your PHP application.

Valkey is the open-source continuation of Redis: it was forked from Redis 7.2 when Redis changed its licence, and it speaks the same protocol. Most guides say that moving is easy: stop Redis, start Valkey on the same data file.

That was true for Redis 7.2. It is not true for the Redis that Ubuntu 26.04 ships. We tested it on a fresh Ubuntu 26.04.1 system on 12 November 2026.

In short

  • Ubuntu 26.04 has Redis 8.0.5 and Valkey 9.0.4 in its archive.
  • Valkey 9 cannot read a Redis 8 dump file: Can't handle RDB format version 12.
  • Replication from Redis 8 to Valkey 9 and the MIGRATE command fail as well.
  • If Redis is only a cache, none of this matters: switch and let the cache fill again.
  • If Redis holds data you need, copy it key by key at the application level, or move from Redis 7.2 before you upgrade.
  • Your PHP code does not change. The redis extension talks to Valkey as it is.

What Ubuntu 26.04 has

apt-cache policy redis-server valkey-server
redis-server:   5:8.0.5-1ubuntu0.1
valkey-server:  9.0.4-0ubuntu0.2

Both are in the archive, and both can be installed on the same machine. Valkey reports itself to clients as a Redis 7.2 server, for compatibility:

redis_version:7.2.4
valkey_version:9.0.4

Three ways that do not work

1. Starting Valkey on the Redis dump file. We wrote a key with Redis 8.0.5, saved, and started Valkey 9.0.4 in the directory with that dump.rdb:

# Can't handle RDB format version 12
# Fatal error loading the DB, check server logs. Exiting.

Redis 8 writes its snapshot in format version 12. Valkey was forked before that format existed and refuses it. The server does not start at all; it does not start empty.

2. Replication. The classic way to move without downtime is to make the new server a replica of the old one:

valkey-cli replicaof 127.0.0.1 6390

The command answered OK, but the link never came up:

role:slave
master_link_status:down

Replication starts by sending the same snapshot format, so it fails for the same reason.

3. MIGRATE. Moving a single key from Redis to Valkey:

ERR Target instance replied with error: ERR DUMP payload version or checksum are wrong

MIGRATE uses the serialised form of the key, which carries the same version.

What works

If it is a cache: just switch. Page caches, object caches, rate-limit counters and most sessions can be rebuilt. Stop Redis, start Valkey empty on the same port, and the application fills it again. Users may have to log in once if sessions were stored there. For most PHP sites this is the whole migration:

sudo systemctl disable --now redis-server
sudo apt-get install valkey-server
sudo systemctl enable --now valkey-server
valkey-cli ping

Valkey's package listens on 127.0.0.1 and port 6379 by default, the same as Redis, with protected-mode yes. Its configuration is in /etc/valkey/valkey.conf and its data in /var/lib/valkey. Copy your own settings (maxmemory, maxmemory-policy, a password) from /etc/redis/redis.conf; they have the same names.

If the data matters: copy it at the command level. A script that reads each key from Redis with ordinary commands (GET, HGETALL, LRANGE, SMEMBERS, ZRANGE … WITHSCORES, plus TTL) and writes it to Valkey works, because ordinary commands are the same on both sides. For queues, the simpler way is to let the workers empty the old queue while new jobs go to the new server.

If you are still on Redis 7.2 or older: move to Valkey before you upgrade to Redis 8. Valkey was forked from 7.2 and is documented as reading its data files. We did not test this path ourselves; test it on a copy.

Does my PHP application change?

No. Valkey speaks the Redis protocol. The PHP redis extension (php8.5-redis 6.2.0 on Ubuntu 26.04) and Predis connect to Valkey without changes. Host, port and password stay as they are.

Two things to check:

  • Modules and newer commands. Redis 8 has built-in data types that came from Redis Stack (JSON, search, time series). Valkey does not have them in its core; some exist as separate Valkey modules. If your application uses JSON.SET or FT.SEARCH, test it first.
  • Version checks. Software that reads redis_version gets 7.2.4 from Valkey. A library that asks for "Redis 8 or newer" will refuse.

Why move at all?

  • Licence. Valkey is BSD-licensed and run by the Linux Foundation. Redis changed its licence in 2024 and again later; whether that matters depends on how you use it.
  • Distribution direction. Several distributions and cloud providers now offer Valkey as their default. Following the default usually means faster security updates.

If neither concerns you, Redis 8 on Ubuntu 26.04 works and is supported by Ubuntu. There is no need to hurry.

With Zefily

Zefily's object cache is Valkey. You install it once in the server's Databases section; after that each PHP site has an Object cache switch that gives WordPress or Laravel its own cache. It listens locally only. See Access, caching and protection.

Frequently asked questions

Can Valkey read a Redis dump.rdb file?

From Redis 7.2 and older, yes, as documented. From Redis 8, no: Valkey 9.0.4 stopped with "Can't handle RDB format version 12" in our test.

Does Ubuntu 26.04 have Redis or Valkey?

Both. The archive has redis-server 8.0.5 and valkey-server 9.0.4.

Do I need to change my PHP code for Valkey?

No. Valkey speaks the Redis protocol, and the PHP redis extension and Predis work with it unchanged.

How do I move from Redis 8 to Valkey?

If it is only a cache, start Valkey empty and let it fill. Otherwise copy the keys with ordinary commands from a script; dump files, replication and MIGRATE do not work between these versions.

Why does Valkey report redis_version 7.2.4?

For compatibility with clients that check the version. Its own version is in valkey_version.

See Web stack for the PHP extensions Zefily installs.

More posts

Black Friday & Cyber Monday

Before you go: lifetime plans are on sale

Pay once for a lifetime plan, or get 30% off the first year of any yearly plan.

Only 100 lifetime plans per plan. When they are gone, they are gone.

See the campaign

Amazing November

See the campaign →