Skip to content
Dominic Létourneau edited this page Feb 25, 2021 · 23 revisions

MongoDB backup

# This will create a dump/MovIt directory with all documents.
mongodump --db MovIt
# This will create an archive of the dump
tar cvzf movit_db_backup.tar.gz dump

MongoDB restore

# Extract the archive (will create the dump directory)
tar xvzf movit_db_backup.tar.gz
# Make sure backend if disabled when updating (it is using the database)
sudo systemctl stop movit_backend.service 
# Restore the DB (from the dump directory)
mongorestore
# Re-Start backend
sudo systemctl start movit_backend.service 

Clone this wiki locally