-
Notifications
You must be signed in to change notification settings - Fork 195
Moving API to new server play book
Leo Lapworth edited this page Nov 18, 2016
·
6 revisions
ssh bm-mc-01.metacpan.org
sudo su - metacpan
cd /home/metacpan/metacpan-api
~/bin/metacpan-api-carton-exec ./bin/metacpan backup --index cpan --type favorite
~/bin/metacpan-api-carton-exec ./bin/metacpan backup --index cpan --type author
~/bin/metacpan-api-carton-exec ./bin/metacpan backup --index user
cd /home/metacpan/metacpan-api/var/backup
scp 2016-11-18-* [email protected]:/tmp/
ssh [email protected]
cd /tmp
gunzip 2016-11-18-cpan-author.json.gz
gunzip 2016-11-18-cpan-favorite.json.gz
perl -pi -e 's/"_index":"cpan_v1"/"_index":"cpan"/g' 2016-11-18-cpan-author.json
perl -pi -e 's/"_index":"cpan_v1"/"_index":"cpan"/g' 2016-11-18-cpan-favorite.json
gzip 2016-11-18-cpan-author.json
gzip 2016-11-18-cpan-favorite.json
sudo su - metacpan
cd ~/metacpan-api
~/bin/metacpan-api-carton-exec ./bin/metacpan backup --index cpan --type author --restore /tmp/2016-11-18-cpan-author.json.gz
~/bin/metacpan-api-carton-exec ./bin/metacpan backup --index cpan --type favorite --restore /tmp/2016-11-18-cpan-favorite.json.gz
~/bin/metacpan-api-carton-exec ./bin/metacpan backup --index user --restore /tmp/2016-11-18-user.json.gz
Switch over the backends
Change backend for metacpan.org ( https://manage.fastly.com/ and deploy )
Update JSON version info
response ( https://manage.fastly.com/ and deploy )