Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

CONFIG REWRITE

Last updated
CONFIG REWRITE
Group
Server
Arity
2 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

CONFIG REWRITE saves the settings changed with CONFIG SET to the config file the server was started with, so they survive a restart. Only settings whose running value differs from what the file says are written. Lines the server does not recognise, and the rest of the file, are left as they are.

Both config file formats work: a Redis-style .conf file and a .toml file. A TOML file is checked before it is written, and left unchanged if the result would not parse.

Case Reply (RESP2 and RESP3)
File written Simple string OK
Server started without a config file Error ERR The server is running without a config file
File could not be written Error ERR Rewriting config file failed, check server logs
127.0.0.1:6379> CONFIG SET slowlog-log-slower-than 5000
OK
127.0.0.1:6379> CONFIG REWRITE
OK

In HotKV Cloud, the CLI tab of the panel does not run CONFIG REWRITE. Run it from your own client connection.

Same replies as Redis 7 and Valkey 8. Redis rewrites only .conf files; HotKV also rewrites TOML config files.

CONFIG SET, CONFIG GET, configuration