Skip to content

Instantly share code, notes, and snippets.

@joadr
Last active October 6, 2016 01:57
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joadr/a6a3fa8b874b011b9161b0ed654886dc to your computer and use it in GitHub Desktop.
Save joadr/a6a3fa8b874b011b9161b0ed654886dc to your computer and use it in GitHub Desktop.
Mongo backup and restore database with gridFS
# Conectarse al servidor remoto
$ ssh root@armatubicicleta.cl
# Hago el dump en el sistema remoto
$ mongodump
# Comprimo el archivo en el sistema remoto
$ tar -zcvf armatubicicleta.tgz dump/armatubicicleta/
# Me descargo el archivo a mi sistema local (desde la terminal local)
$ scp root@armatubicicleta.cl:/root/dump/armatubicicleta.tgz /home/joaco/armatubicicleta.tgz
# Descomprimo el archivo
$ tar -zxvf armatubicicleta.tgz
## entro a la carpeta y cargo la base de datos
$ cd armatubicicleta
$ mongorestore --port 3001 --db meteor /home/joaco/armatubicicleta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment