This document will cover the process in how to backup and restore the Humly Control Panel database. It is strongly recommended to create a backup copy of the database before manually editing the database contents.
In this article you will find support for:
- Create Backup of Humly Control Panel Database on Windows
- Create Backup of Humly Control Panel Database on Linux
- Restore Database backup to Humly Control Panel on Windows
- Restore Database backup on Humly Control Panel on Linux
Create Backup of Humly Control Panel Database on Windows
- Start two PowerShell consoles as an administrator and change the directory in both to the MongoDB bin directory, the default path for MongoDB below, however, this might differ if MongoDB has been installed in a customized location.
C:\Program Files\MongoDB\Server\4.2\bin
- Go to services and stop HCP service.
- Stop MongoDB Server service.
- In one of the PowerShell consoles, start MongoDB by this command.
./mongod --dbpath ..\data
Leave this PowerShell window opened, you can minimize it if you want. - Switch to the second PowerShell window, and write this command.
./mongodump
The output should be similar to this screenshot
- The Database backup is done and the dump is stored in a subfolder under the bin folder.
Note: Repeating the above process will overwrite the existing backup.
Create Backup of Humly Control Panel Database on Linux
- Change directory to Humly Control Panel installation folder.
- Start the DB backup script by writing this command.
sudo bash backupdb.sh
The output should look like the below screenshot and the location of the backup will be reported by the end of the script.
Restore Database backup to Humly Control Panel on Windows
Steps 1 to 3 are the exact same steps in creating a Database backup on Windows.
- Start two PowerShell consoles as an administrator and change the directory in both to the MongoDB bin directory, the default path for MongoDB below, however, this might differ if MongoDB has been installed in a customized location.
C:\Program Files\MongoDB\Server\4.2\bin
- Go to services and stop HCP service.
- Stop MongoDB Server service.
- In one of the PowerShell consoles, start MongoDB by this command.
./mongod --dbpath ..\data
Leave this PowerShell window opened, you can minimize it if you want.
- Copy the dump folder into a subfolder under the bin in MongoDB installation
C:\Program Files\MongoDB\Server\4.2\bin\dump
On the second PowerShell window, start the restore process by writing this command.mongorestore --drop dump\
The output should look like the screenshot below:
- Close the PowerShell windows by using Ctrl+C on both windows, Start HCP service from windows services msc.
Restore Database backup on Humly Control Panel on Linux
- Change directory to Humly Control Panel installation folder.
- Start the DB restore script by writing this command.
sudo bash restoredb.sh
The output should look like the below screenshot:
You will be asked by the end of the script if you want to keep the backup files or delete them.
After MongoDB service and HCP service will be restarted automatically.