-
Notifications
You must be signed in to change notification settings - Fork 24
Migrating Redis
Copying data from production can be done without stopping Redis, but for the final sync, Redis should be stopped.
-
From the server to which you wish to copy Redis data, verify the location of the Redis directory
grep --color var /etc/redis.conf
-
Change to that directory, verify that there is a file there named
dump.rdb
cd /var/lib/redis
-
Stop Redis, copy the data, and restart
sudo service redis stop sudo cp -p /scholarsphere/ssrepo1prod/redis/dump.rdb . sudo chown redis * sudo chgrp redis * sudo service redis start
-
Login to Redis via
redis-cli
and from the Redis command line:keys *
You should see at least 190,958 keys and some with names like "GenericFile:707957774:event"
From the web server that is connected to the repo server which you synced data to in the above process:
cd ~/scholarsphere/current
RAILS_ENV=production bundle exec rake scholarsphere:redis:migrate
Wait about 10 minutes & Verify
From the repo server to which the Redis data has been migrated:
redis-cli
- Redis command:
keys *
- Redis command:
keys *GenericFile*
You should see at least 18653 keys, some with names like "scholarsphere:GenericWork:5712mt01c:event" and no keys with "GenericFile" in them.