Created
November 11, 2016 21:42
-
-
Save felipsmartins/36fd3bf3edb789095bb6b6f337877918 to your computer and use it in GitHub Desktop.
MongoDB restore databse from local to remote server
This file contains hidden or 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
| #!/bin/bash | |
| # Restaura base de dados a partir de um backup local para o servodor remoto MongoDB | |
| # autor: Felipe Martins <felipe.martins@3eengenharia.com.br> | |
| # | |
| # onde está o arquivo contento o backup. O diretório geralmente tem o mesmo nome da base de dados. | |
| export FROM_DATABASE_PATH=/path/database-dump | |
| export MONGODB_HOST= | |
| export MONGODB_DATABASE= | |
| export MONGODB_USERNAME= | |
| export MONGODB_PASSWORD= | |
| mongorestore --drop --dir=$FROM_DATABASE_PATH -d $MONGODB_DATABASE -h $MONGODB_HOST -u $MONGODB_USERNAME -p $MONGODB_PASSWORD | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment