Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Migrating Redis

cam156 edited this page May 23, 2017 · 3 revisions

Syncing data from production

Copying data from production can be done without stopping Redis, but for the final sync, Redis should be stopped.

  1. From the server to which you wish to copy Redis data, verify the location of the Redis directory

    grep --color var /etc/redis.conf

  2. Change to that directory, verify that there is a file there named dump.rdb

    cd /var/lib/redis

  3. 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
    
  4. 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"

Migrating

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

Verifying Redis data migration

From the repo server to which the Redis data has been migrated:

  1. redis-cli
  2. Redis command: keys *
  3. 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.

Clone this wiki locally