Getting a good consistent backup of the SM data drive
Question asked by echoDreamz - 1/16/2020 at 2:38 AM
SmarterMail is not VSS-aware, so I am concerned about getting a good consistent snapshot of the SM data array. Software like MySQL, SimpleDNS and a few other systems we use have a way to tell the server or application "Hey, backup is about to start... do what you need to do to commit whatever to disk". For example, MySQL, we can lock tables/flush tables etc. to make sure that any VSS snapshots contain a fully consistent state of the server, once the VSS snapshot has finished, we have MySQL release table locks etc. so it can resume full normal operations.

SmarterMail has a ton of moving parts, files are changing, updating, writing to, created etc. so in the event there is a full catastrophic failure, the odds of our VSS-based backups being in a consistent state is probably 0. We could shutdown the service, start the backup, wait for the snapshot to complete, then restart the service, but stopping and starting a mailserver nightly isnt great.

Exchange of course is VSS-aware, Zimbra offers a backup/restore system that creates safe backups, wondering what the ST developers think about getting SmarterMail to allow us to create safe and consistent backups, especially since we are venturing into Exchange territory with EWS, EAS, MAPI.

8 Replies

Reply to Thread
Good point Christopher! This is a very important note to be aware of.

I think you should stop Smartermail Service, start VSS backup and then start SmarterMail Service without wait the full backup is finished.
The anly part you must wait to be completed is the VSS snapshot BEFORE the backup start the real copy of data, BUT I don't know how to be aware of the completion of the VSS snapshot...

We use Veaam for our backup...
echoDreamz Replied
The system we use has “hook points” where you can call different apps or batch files etc. at different points during the back up process. Such as onSart beforeSnapshot duringSnapshot etc. 
Matt Petty Replied
Employee Post
Just curious how long do snapshots usually take? I could see the potential for stopping services, things like indexing and spool.
Matt Petty
Software Developer
SmarterTools Inc.
(877) 357-6278
Ronald Raley Replied
Snapshots in our VM environment take about 30 seconds.

echoDreamz Replied
A few minutes for us. 
echoDreamz Replied
I dont think stopping the service every single night is a good idea unfortunately. We have customers all around the world who would immediately notice, start submitting tickets, calls, chats etc. We could explain to them until we are blue in the face about why, but customers dont care, they will just be upset mail is going up and down daily.

I realize this is the best way to do this, but with mail going up and down nightly, we wouldnt have any customers left to worry about backing up. I think if SM wants to compete in the Enterprise space, directly against Exchange, we need to have a clear way to make consistent backups without having to shutdown the server.

Matt - Your idea for stopping services within SM is nice, but it is also destructive. MySQL for example (far less moving parts I am sure). When we lock the tables, user apps can still read from them OK, but queries like INSERT, UPDATE, REPLACE etc. are held up until the lock on the tables is released, this doesnt break user applications or report any errors, it is basically seamless to the end user minus the little slowdown for write operations.
I agree, Christopher
echoDreamz Replied
So I created a simple app that uses the SM API to stop all the services within SM, then we call an iisreset /stop to prevent users from doing any actions via the SM interface.

-- Backup app starts
-- Backup app says its about to create a VSS snapshot
--- App shuts down the SM services and stops IIS
-- Backup app starts the snapshot
-- Backup app completes the snapshot
--- App starts IIS and then starts the SM services

When SM stops a service though, does all activity stop for that service or is there a delay?

Reply to Thread