Restore procedures

Step by step how-to instructions on installing and running KoBo Toolbox on a standalone server.
Jump to: navigation, search

Postgres

$ PGDUMP=201701010330.pgdump
$ cd $KOBO_DOCKER
$ sudo cp /srv/kobo-backup/$PGDUMP .vols/db/backup/restore.pgdump
$ sudo docker exec kobodocker_postgres_1 bash -c "pg_restore --format=c --no-privileges --no-owner kobotoolbox -U postgres  /srv/db/backup/restore.pgdump"
$ sudo rm .vols/db/backup/restore.pgdump

Mongo

$ MONGODUMP=mongo_backup__2017.01.01.01_57.mongorestore.tar.gz
$ cd $KOBO_DOCKER
$ sudo rm -rf .vols/mongo/backups/dump
$ sudo tar xfvz /srv/kobo-backup/$MONGODUMP -C .vols/mongo/backups/
$ sudo docker exec kobodocker_mongo_1 bash -c "cd /srv/backups && mongorestore"
$ sudo rm -rf .vols/mongo/backups/dump

Recreate Mongo DB

Alternatively to restoring Mongo database from archive, you can re-create this database from Postgress data by issuing the following command:

$ cd $KOBO_DOCKER
$ sudo docker exec -it kobodocker_kobocat_1 python manage.py remongo

User generated files

$ MEDIARCHIVE=kobocat_media__2017.01.01.01_51.tar
$ cd $KOBO_DOCKER
$ sudo cp /srv/kobo-backup/$MEDIARCHIVE backups/kobocat/restore.tar
$ sudo docker exec kobodocker_kobocat_1 bash -c "tar xpf /srv/backups/restore.tar -C /srv/src/kobocat/media/"
$ sudo rm backups/kobocat/restore.tar