Steps to Change MongoDB's Data Storage Location

Steps to Change MongoDB's Data Storage Location

KB ID: 97
Challenge:
Migrating Vembu BDR's internal MongoDB database data files from one location to another.
Cause:
As the size of backup data increases, the internal meta-information storage space used by MongoDB in the Vembu BDR server may also increase. If the current storage location lacks sufficient space for write operations, it becomes necessary to migrate the data to a new location.
Solution:
For Windows:
Step 1: Stop Services - Stop the Vembu BDR and MongoDB services in the services.msc console.

Step 2: Open Registry EditorOpen the registry editor (regedit).
Step 3: Update MongoDB Service Imagepath Navigate to the MongoDB service and update the ImagePath with the new dbpath.

Step 4: Copy Data Folders - Copy the old data folders and paste them in the new location.

Step 5: Start ServicesStart the MongoDB and BDRSuite services.

For Linux:
Step 1: Stop Services - Stop the Vembu BDR and MongoDB services using the following commands:
   /etc/init.d/mongo stop
   /etc/init.d/vembubdr stop

Step 2: Open MongoDB Config File - Open the MongoDB config file located in /opt/config/mongodb using a text editor.

Step 3: Update dbpath - In the config file, find the `dbpath` entry and update it with the new location.

Step 4: Copy Data Folders - Copy the old data folders and paste them in the new location.
Step 5: Start Services - Start the MongoDB and Vembu BDR services.
‚Äč
Following these steps allows for a seamless migration of MongoDB's data storage location in Vembu BDR, ensuring continued functionality and improved storage management.