hMailServer 4.2 and later versions includes built-in backup support. In the backup settings in hMailAdmin, you can define the type of objects that should be backed up.
It is possible to backup hMailServer while the server is running. However, if you do so, there is a risk that some data will not be backed up. A typical scenario is when you try to backup when hMailServer has only partially received a message. If you want to be sure that everything is backed up, you should stop the server before doing the backup.
Robocopy does everything that
xcopy does, but it can also "synchronize", or mirror, two directories, thereby only copying the difference. That is much faster. You can copy files to a backup directory the usual way, while the hMailServer service is running. At a convenient time later, you stop the service and copy again using
robocopy. This second copy will be much faster, as it will only copy the changes. This can help minimize downtime. However, beware that
robocopy can cause disaster if you use it with the wrong switches. Please, read its documentation carefully before using it.