Files
valkey/migrate_redis_to_valkey.bash

40 lines
1.5 KiB
Bash
Raw Permalink Normal View History

- Update to 7.2.6: - Bug Fixes - Core * Fix typo in REGISTER_API macro to prevent segfaults when loading Redis modules (#608) * Fix the command duration reset issue when clients are blocked and commands are reprocessed (#526) * Fix the data type conversion error in zrangeResultBeginStore (Redis#13148) * Fix a crash caused by quicklist node merges (Redis#13040) * Fix crashes in module blocking client timeout cases (Redis#13011) * Fix conversion of numbers in Lua args to Redis args (Redis#13115, Fixes Redis#13113) * Fix crash in LSET command when replacing small list items with larger ones, creating listpacks larger than 4GB (Redis#12955, Fixes Redis#12864) * Fix blocking command timeout reset issue during reprocessing (Redis#13004) - Bug Fixes - Cluster * Fix the CLUSTER SHARDS command to display accurate slot information even if a primary node fails (#790, Fixes #784) * Fix an issue where module authentication failed when the cluster was down (#693, Fixes #619) * Ensure only primary nodes with slots can mark another node as failed (#634) * Improve MEET command reliability under link failures to maintain cluster membership symmetry (#461) * Allow single primary node to mark potentially failed replica as FAIL in single-shard cluster (Redis#12824) - Bug Fixes - Sentinel * Accept redis-sentinel to start Valkey in sentinel mode (#731, Fixes #719) - Bug Fixes - CLI * Ensure the --count option in redis-cli works correctly even without --pattern (Redis#13092) * Fix redis-check-aof misidentifying data in manifest format as MP-AOF OBS-URL: https://build.opensuse.org/package/show/server:database/valkey?expand=0&rev=13
2024-09-03 06:28:08 +00:00
#!/bin/bash
# Identify whether any config files exist
configfiles=($(find /etc/redis -maxdepth 1 -name "*.conf"))
redisunits=($(find /etc/systemd/system -maxdepth 1 -name "redis@*.service" -execdir basename {} \;))
sentinelunits=($(find /etc/systemd/system -maxdepth 1 -name "redis-sentinel@*.service" -execdir basename {} \;))
if [ ${#configfiles[@]} -gt 0 ]; then
for configfile in ${configfiles[@]}
do
configfilename=$(basename "$configfile")
cp $configfile /etc/valkey/$configfilename
chown root:valkey /etc/valkey/$configfilename
mv $configfile ${configfile}.bak
done
sed -e 's|^dir\s.*|dir /var/lib/valkey|g' -i /etc/valkey/*.conf
sed -e 's|^logfile\s/var/log/redis/|logfile /var/log/valkey/|g' -i /etc/valkey/*.conf
echo "/etc/redis/*.conf has been copied to /etc/valkey. Manual review of adjusted configs is strongly suggested."
fi
if [ ${#redisunits[@]} -gt 0 ]; then
for redisunit in ${redisunits[@]}
do
systemctl disable "${redisunit}"
systemctl enable "valkey@${redisunit##*@}"
done
fi
if [ ${#sentinelunits[@]} -gt 0 ]; then
for sentinelunit in ${sentinelunits[@]}
do
systemctl disable "${sentinelunit}"
systemctl enable "valkey-sentinel@${sentinelunit##*@}"
done
fi
if [ -d /var/lib/redis ]; then
cp -r /var/lib/redis/* /var/lib/valkey/
chown -R valkey:valkey /var/lib/valkey
mv /var/lib/redis /var/lib/redis.bak
echo "On-disk redis dumps copied from /var/lib/redis/ to /var/lib/valkey"
fi