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.


will this work for version 12?
Jon Eastwood (2/18/2014 at 2:22 PM)
Hi, Jon. Yes, this will work with 12.x as well. Just forgot to modify the KB to the most current version. Sorry for the confusion.
Derek Curtis (2/18/2014 at 2:45 PM)
What about Windows server backup, that should work to?

We backup everything on the server, as we do not have huge amounts on the server yet.

Backup destination is a dedicated big external USB drive...

Kenneth Knudsen (5/28/2015 at 10:53 AM)
Hi Kenneth,
Windows server backup should be fine.

Brian Ward (5/28/2015 at 11:58 AM)
Really though, how good is this? We use a bare metal image of the SmarterMail storage array, it does a VSS snapshot, however SM is not VSS aware. Our server is heavily active, so I am wondering is that VSS snapshot really safe?
echoDreamz (5/18/2018 at 10:38 PM)

The VSS backup should be safe from my experience since SmarterMail does not really rely on memory caches or other such technologies that would benefit from application aware VSS backups. Essentially SmarterMail's file system, or system state would not be in an inconsistent state when the VSS writer performs the snapshot operation and therefore would not benefit from VSS awareness since SmarterMail commits changes they are immediately written to the appropriate configuration and message locations and are not cached into memory.

I've assisted several customers running a variety of backup solutions in restoring from backup sets without issue. Almost all of these customers are leveraging bare metal backups, or application aware VM backups both leveraging VSS snapshots.

Von-Austin See (5/21/2018 at 3:41 PM)