Script to (atleast on OS X) pull the newest mongo dump and import it, maintaining users.

This commit is contained in:
Rob 2015-10-23 14:29:24 -07:00
parent 5f56053d8f
commit 96654bd08f

8
bin/coco-pull-test-db Executable file
View file

@ -0,0 +1,8 @@
DIR=`mktemp -dt coco`
curl http://analytics.codecombat.com:8080/dump.tar.gz | tar -xC $DIR
mongoexport --db coco --collection users --out $DIR/users.json
mongorestore --drop --batchSize 100 $DIR/dump
mongoimport --db coco --upsert -c users $DIR/users.json
cat $DIR/users.json
rm -r $DIR