Regularly Back Up SmarterMail Using RoboCopy

This article applies to recent versions of SmarterMail. View articles for SmarterMail 16.x and earlier.

Regularly backing up your email files is a good practice to keep as it helps prevent the loss of important data in the event of a hardware crash, hard drive corruption, system failures, etc. If you do not have a professional backup solution in place, you can set up a scheduled task in Windows to fully back up the SmarterMail installation on a regular basis. The backup can be stored on a separate hard drive or a dedicated folder of an existing drive. RoboCopy is a command-line directory replication command used as a backup solution for smaller companies. NOTE: The source folders are mirrored with the destination folders, so any folders or files that exist in the destination but no longer exist in the source will be removed. As a result, you must use an empty directory to store the backup, as all existing files in the destination directory will be deleted.

Follow these steps to configure Windows to regularly back up SmarterMail:

  1. Create a batch file in C:\ called backupsmartermail.bat.
  2. Edit it with notepad and enter the following, replacing DEST:\FOLDER\ with the destination drive and folder of the backup:
@echo off
cd "C:\Program Files\Windows Resource Kits\Tools\"
md "DEST:\FOLDER\service"
md "DEST:\FOLDER\mail"
echo Backing up config files...
robocopy "C:\program files\smartertools\smartermail\service\settings" "DEST:\FOLDER\service\settings" *.json *.dat /ZB
echo Backing up mailboxes...
robocopy "C:\SmarterMail" "DEST:\FOLDER\mail" /MIR /R:6 /W:10 /ZB

4. Save the file.
5. Add a scheduled task to Windows to execute the .bat file on a regular basis.

NOTE: Professional backup solutions will typically be more resilient to failures and file locking, but for those without the budget to buy one of those solutions, this is better than doing no backups at all. Use of this method of backup is not supported by SmarterTools. Please exercise caution when setting up the backup and confirm that the backup is running correctly by executing a trial run.

Learn more about SmarterMail's enterprise email features and benefits.