Database Reference
In-Depth Information
Moving dbpath to the new server
MongoDB uses a directory called dbpath to store everything related to the instance, in-
cluding databases, collections, users, and so on.
A very simple but error-prone way to migrate the mongod instance is to copy this direct-
ory to the new server and start the new instance using this existing directory.
The following screenshot shows the content of a database directory:
You can use dbpath to define the directory path for an instance. The following configura-
tion file sets the database directory to /db/mongodb :
dbpath = /db/mongodb
port = 27017
Also, you can use the following command-line parameter:
mongod --port 27017 --dbpath /db/mongodb
After moving the database directory to the new server and configuring the dbpath , you
can start a new instance in the new server and point the application's database connection to
the new sever.
Search WWH ::




Custom Search