If you wish to take Sage X3 installed MongoDB Syracuse database backup and schedule it, you could perform the task in following steps.
Step 1. MongoDB tool “mongodump” setup
In the installed MongoDB folder, you should find MongoDB tools. In my case “mongodump” tool is in the below folder.

Include “mongodump” tool in server System environment path variable

Step 2: Backup batch file
In text editor create a text file with extension .bat with following command line syntax
@ echo off
REM To create date folder 'DTF' formatting system date by separating it in Day / Month/ Year
SET dd=%date:~0,2%
SET mm=%date:~3,2%
SET yyyy=%date:~6,4%
SET DTF=%dd%-%mm%-%yyyy%
REM Before running backup setting Backup parameters as per MongoDB installation
REM 1.Hostnmae: "--host X3ERPV12VM "
REM 2 Port: "--port 27017"
REM 3 Certificate details and location: --ssl --sslPEMKeyFile "C:\Sage\Safex3\MongoDB\certs\client.pem" --sslPEMKeyPassword " " --sslCAFile "C:\Sage\Safex3\MongoDB\certs\ca.cacrt"
REM 4 MongoDB Database: "Syracuse"
Rem 5 Backup folder location: "--out X:\mongoback\%DTF%"
mongodump.exe --host W25-SQL22-X3V12 --port 27017 --ssl --sslPEMKeyFile "X:\Sage\WebComponents\MongoDB\certs\client.pem" --sslPEMKeyPassword " " --sslCAFile "X:\Sage\WebComponents\MongoDB\certs\ca.cacrt" --db syracuse --out X:\mongoback\%DTF%
@ echo "Backup successful"

Note:
You may need to verify the date format of the server (based on regional setting) and make the changes in the date parameter for dd mm yyyy
Step 4: Verify backup
Run the batch file created above to verify is the backup is done without issue.
Ideally you should find the Syracuse backup inside current date folder in your designated folder location in the batch file

Step 5: Scheduling Syracuse database backup
Open Task scheduler of the server where MongoDB is installed
A. Create Task
- Specify Name of the task
- Run with highest privileges

B. Set Trigger Tab
Set the trigger as per your requirement

C. Action Tab
- Action: Start a program
- Program Script: Location of your backup batch file

D. Setting Tab
Verify condition and setting tab, leave default or change if necessary
Select Ok and make sure you have User with appropriate windows rights who will run the task

Step 6 : Verify the schedule Job
Run the Schedule job manually to verify if the backup is done successfully


Top Comments