
For details, please visit Outsourced Managed IT Services.Once the download is finished, run. To open access from your own host IP, you need to open port number 27017 (MongoDB server Port) to all connections or to specific IP in the firewall.Īt Velan, our database support engineers can help you with your database-related issues. In certain cases, we may have to give access to users on the new servers. Access to users on the Production server.Mongorestore -host=mynewserver -port=27017 -username=user -authenticationDatabase=admin -dbexampledb /opt/backup/mongodump-exampledb # mongorestore -host -ssl -username -password -authenticationDatabase admin -db -collection įor eg: To restore the exampledb database, we used Once the backup file has been copied to the destination server, mongorestore command is used to restore the database. Restore MongoDB database in the destination server.In normal servers, this requires firewall changes to that the connection between the servers can work. To make scp work, we need to adjust the security group settings from the AWS console.

WE used scp to transfer files as development and production servers were in AWS.

WE can use the scp or rsync commands to copy the files. The next step is to copy the backed-up files to the destination server. Copy MongoDB database files to the destination server.Mongodump -h myservername:27017 -ssl -u user1 -p 123123 -authenticationDatabase admin -d exampledb # mongodump –host -ssl –username -password -authenticationDatabase admin –dbįor eg: To take the dump of the database with name exampledb, the command will be To create a database backup, we use the mongodump command To stop the MongoDB on the server, we would use the following command –

It is always good to shutdown the database servers to remove any connections before backing up the server. The steps include the creation of backup, copying of the database to the destination server, restoring the database in the destination folder.

This article describes the steps involved in copying Mongo DB files to production serversīelow are the steps to copy MongoDB database filesfrom development to live server. We at Velan, help the developers as part of our Server Management Services. Web Application developers frequently request to copy the Mongo DB from one server to another. Copy MongoDB Database Files support the volume of data and it comes in handy in apps that need to scale up as per usage.
