Last active
October 6, 2016 01:57
-
-
Save joadr/a6a3fa8b874b011b9161b0ed654886dc to your computer and use it in GitHub Desktop.
Mongo backup and restore database with gridFS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conectarse al servidor remoto | |
$ ssh [email protected] | |
# 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 [email protected]:/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