You can move or copy a MongoDB Server database using the manual procedure below or by simply packaging the database up using Control Architect and then unpacking to a new local or remote MongoDB Server. Control Architect can both package and unpack to remotely connected Mongo servers as well as a locally hosted Mongo server.
Manually Moving/Copying a Mongo Database
You can move the MongoDB Server database to a new location on the same machine or to another machine by following these steps below. If you are installing to a new local Host Server, you must first install Control Architect and MongoDB Server using the Control Architect installer. This will automatically install MongoDB Server if it is detected as not installed.
Stop the MongoDB Service
Locate the MongoDB Database folder path
Stop the MongoDB Service on the target machine
Copy this root MongoData folder and its subfolders to its new location
Locate the MongoDB Configuration file
This configuration files should be located in the path "C:\ProgramData\Automation Software Technology, Inc\MongoDB"
Modify the existing path configuration in the mongod.cfg file to the new target paths.
Modify the dbPath and path variables to reflect the new target path locations. Do not change any other variable data. Maintain the 2 character tab spacing.
Delete the MongoData\Journal files
The journal files located in the MongoData\Journal path must be deleted. This will assure that older transactional journals are cleared when the Service is restarted.
Restart the MongoDB Service on both the source and target machines