Import huge mongo database from another server in the background

1. Run the following commands :
screen
mongo
use admin
db.runCommand({copydb:1,fromhost:’83.10.17.18:27017′,fromdb:’fromdbname’,todb:’todbname’})
ctrl + a + d (after pressing a in order to exit the screen)

2. Now exiting the SSH session, will still keep the command running. In order to get back to the screen, use the following command
screen -r

Reference : https://docs.mongodb.com/manual/reference/command/copydb/
http://www.tecmint.com/keep-remote-ssh-sessions-running-after-disconnection/
dsad

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s