Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Allow syncing data to gov.uk dev vm
Browse files Browse the repository at this point in the history
As we move to gov.uk infrastructure, we will need to use the gov.uk dev vm -
allow this by passing govuk_dev as the destination host argument. Also
update the readme to be a little more verbose and include this argument.
  • Loading branch information
timmow committed May 28, 2015
1 parent 3fc2952 commit 1fb5326
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ Other parameters:

## Useful tools

* Copy data from an environment to the local Backdrop database (should be run on your host machine): `cd tools && ./replicate-db.sh <youruser>@mongo-1.pp-preview`
### Sync data from environment

Copy data from an environment to the local Backdrop database (should be run on your host machine): `bash tools/replicate-db.sh mongo-1.pp-preview`

You may need to setup your [ssh config](https://github.gds/pages/gds/opsmanual/2nd-line/technical-setup.html#ssh-config) correctly for this to work

To sync to the govuk dev vm, you can pass `govuk_dev` as the 2nd argument to this script -

`bash tools/replicate-db.sh mongo-1.pp-preview govuk_dev`


## Emptying a dataset

Expand Down
4 changes: 4 additions & 0 deletions tools/replicate-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ if [ -z "$2" ]; then
pushd ../../pp-puppet/
vagrant ssh development-1 -c "cd /var/apps/backdrop/tools && mongorestore --drop ${DUMPDIR}"
popd
elif [ "$2" = 'govuk_dev' ]; then
pushd ../../puppet/development
vagrant ssh -c "cd /var/govuk/backdrop/tools && mongorestore --drop ${DUMPDIR}"
popd
else
mongorestore --drop -h $DESTINATION_HOST $DUMPDIR
fi
Expand Down

0 comments on commit 1fb5326

Please sign in to comment.