Steps to change the MongoDB's data storage location

KB ID : 97
Published : Jan. 28, 2016
Created : Jan. 28, 2016
Last Modified : Dec. 18, 2016

Challenge

Migrating Vembu BDR internal database(MongoDB) data files from one location to another location.

Cause

As Backup data size increases in the Vembu BDR server, the internal meta information storage space for MongoDB also will increase. In case the meta information storage location is not having enough space for write, then follow the below steps to migrate the data to some other location.

Solution

For Windows

Step 1 :

Stop the Vembu BDR and Mongo Services in services.msc

Vembu BDR and Mongo Services

Step 2:

Open regedit (registry)

Step 3:

Go to MongoDB Service and change the Imagepath with new dbpath.

 MongoDB Service and change the Imagepath with new dbpath

Step 4: (Most Important step)

Copy the old data folders and paste it in new location.

old data folders

Step 5:

Start the Mongo and Vembu BDR Services.

 Mongo and Vembu BDR

For Linux

Step 1:

Stop the Vembu BDR and Mongo Services! You can stop the services using below cmd:

/etc/init.d/mongo stop

/etc/init.d/vembubdr stop

/etc/init.d/vembubdr stop

Then open the Mongo config file.

Step 2:

Open the config file using vi editor. Mongo config file can be found in /opt/config/mongodb.

/opt/config/mongodb

Step 3:

In that file, find dbpath. Then, update the new location accordingly.

find dbpath

Step 4: (Most Important step)

Copy the old data folders and paste it in new location.

Step 5:

Start the Mongo and Vembu BDR Services

Mongo and Vembu BDR Services

edit retag flag offensive close merge delete