Difference between revisions of "Backup and Restore"

[checked revision][unchecked revision]
Line 7: Line 7:
  
 
When using external backup software (e.g. Symantec Backup Exec, Windows NTBackup or Acronis True Image,) a few measures have to be taken to be able to create a successful backup. However, it has the advantage that the MailStore Server data can be integrated into existing backup strategies without having to perform a separate system backup.
 
When using external backup software (e.g. Symantec Backup Exec, Windows NTBackup or Acronis True Image,) a few measures have to be taken to be able to create a successful backup. However, it has the advantage that the MailStore Server data can be integrated into existing backup strategies without having to perform a separate system backup.
 
<p class="msnote">'''Please note:''' In MailStore's ''Administrative Tools'' under ''Storage Locations'', older archive stores can be write-protected. Write-protected archive stores remain available to all users (although they cannot be moved or deleted) and no longer have to be included in ongoing backup procedures. These archive stores can be stored on cost-efficient storage media. More information about archive stores and storage locations is available under [[Storage Locations]].</p>
 
  
 
=== Which Data Must be Backed Up? ===
 
=== Which Data Must be Backed Up? ===
Line 31: Line 29:
 
To create a complete database backup, proceed as follows:
 
To create a complete database backup, proceed as follows:
  
* Log in as MailStore administrator (admin)
+
* Log on to MailStore Client  as MailStore administrator.
* Click on ''Administrative Tools'' > ''Storage'' and select ''Create Archive Backup''.
+
* Click on ''Administrative Tools'' > ''Management API'' and then ''Jobs''.
*: [[File:bkup_archive_01.png|center|450px]]
+
* Click on ''Storage'' and select ''Create Backup''.
* Enter the ''Target Directory'' for the backup.
+
*: [[File:Jobs_create_backup_01.png|center|450px]]
 +
* Enter the ''target directory''
 
*: '''Please note:''' If the target directory is a network share, make sure  that the MailStore Server service has access to that share. Further information are available in the [[Using Network Attached Storage (NAS)]] article.
 
*: '''Please note:''' If the target directory is a network share, make sure  that the MailStore Server service has access to that share. Further information are available in the [[Using Network Attached Storage (NAS)]] article.
* Specify the scope of the backup. For determining which archive stores should be included in the backup, the following options are available:
+
* Define the start time for the backup in the ''Schedule'' section.
** '''Backup all archive stores''' - All currently attached standard archive stores are archived.
+
* Click ''OK'' to finish the creation of the backup job.
** ''' Backup all archive stores that are not write-protected''' - With MailStore Server archive stores can be write-protected. Users are still able to access the data of a write-protected archive store but are no longer able to make any changes (by adding or deleting emails). If a backup of a write-protected standard archive store has already been performed, it can be excluded from the backup procedure using this option.
 
** '''Backup the following archive stores''' - With this option the backup can be limited to specific standard archive stores.
 
* After selecting the appropriate option, click on ''Start Now'' to perform a single backup.
 
 
 
To perform a backup at regular intervals, a task must be created manually in the Windows Task Scheduler. The necessary steps are described in the next section.
 
 
 
=== Automating the Backup ===
 
Once the backup has been successfully executed manually, it can easily be  automated based on these settings by following the steps below:
 
 
 
* Click ''Copy Cmd Line'' to copy the command line into the clipboard.
 
*:'''Notice for users for MailStore Server <= 9.0.3:''' Paste the copied command line into an empty text document and copy only the second line again, to get rid of the comment on the first line. Otherwise the command line is not detected correctly by the Windows Task Scheduler.
 
* Open the ''Task Scheduler'' by using the Windows start menu or execute the command ''taskschd.msc''.
 
* Right click on ''Task Scheduler Library'' and select ''Create Basic Task...'' from the context menu.
 
* In the first step enter a name for the newly created task, i.e. "MailStore Backup" and afterwards click on ''Next''.
 
*: [[File:Backup_sched_01.png|center|450px]]
 
* Now select when or how often to run the backup. Depending on the previous selection, additional settings may have to be done after clicking ''Next''. Afterwards click on ''Next'' again.
 
*: [[File:Backup_sched_02.png|center|450px]]
 
* Choose ''Start a Program'' as action and click ''Next''.
 
*: [[File:Backup_sched_04.png|center|450px]]
 
* Paste the copied command line from the beginning into the text field ''Program/script''.
 
*: [[File:Backup_sched_05.png|center|450px]]
 
* After clicking on ''Next'', the task scheduler asks whether to split the command line into a program call and argument list. Answer this question with ''Yes''.
 
*: [[File:Backup_sched_06.png|center|350px]]
 
* Activate the option ''Open the Properties dialog for this task when I click Finish'' in the summary and click ''Finish''.
 
*: [[File:Backup_sched_07.png|center|450px]]
 
* Click on ''Change User or Group...''.
 
*: [[File:Backup_sched_08.png|center|450px]]
 
* Enter ''SYSTEM'' into the text box and click ''OK''.
 
*: [[File:Backup_sched_09.png|center|350px]]
 
* The task will now be run as the ''NT_AUTHORITY\SYSTEM'' account, the same account as the MailStore Server service.
 
*: [[File:Backup_sched_10.png|center|450px]]
 
* To close the properties dialog click on ''OK'' again.
 
  
A new task for executing the backup regularly has now been created in the ''Task Scheduler Library''.
+
If necessary run the job manually in order to verify that MailStore Server is able to create a backup without errors.  
  
 
<p class="msnote">'''Please note:''' The archive cannot be accessed while a backup is in progress. Trying to access the archive will generate the error message "Due to maintenance the server is currently unavailable."</p>
 
<p class="msnote">'''Please note:''' The archive cannot be accessed while a backup is in progress. Trying to access the archive will generate the error message "Due to maintenance the server is currently unavailable."</p>
Line 90: Line 57:
 
When using Volume Shadow Services (VSS) or other methods of creating snapshots on storage level, it is necessary to ensure that all files used by the instances are closed before the snapshot is created.  
 
When using Volume Shadow Services (VSS) or other methods of creating snapshots on storage level, it is necessary to ensure that all files used by the instances are closed before the snapshot is created.  
  
The MailStore Server service provides external backup software using Microsoft Volume Shadow Service with a so-called Volume Shadow Service Writer (VSS Writer). The external backup software can use it to create consistent backups of the MailStore master database and all standard archive stores. If this method succeeds, however, largely depends on the backup software which is used. The VSS Writer has to be activated in the [[MailStore_Server_Service_Configuration|MailStore Server Service Configuration]].
+
The MailStore Server service provides external backup software using Microsoft Volume Shadow Service with a so-called Volume Shadow Service Writer (VSS Writer). The external backup software can use it to create consistent backups of the MailStore master database and all standard archive stores. Whether this method succeeds, however, largely depends on the backup software and the storage which is used. The VSS Writer has to be activated in the [[MailStore_Server_Service_Configuration|MailStore Server Service Configuration]].
  
 
To verify if the appropriate VSS events were initiated in MailStore during a backup, open the system protocol in the Windows event viewer and search for the following events:
 
To verify if the appropriate VSS events were initiated in MailStore during a backup, open the system protocol in the Windows event viewer and search for the following events:

Revision as of 12:12, 12 June 2015

Backup

Preliminary Considerations

MailStore Server supports two methods to perform a full backup of the email archive including all user settings: the MailStore integrated backup feature and the use of external backup software.

Which method best suits the needs of your business depends on your preferences as well as your system environment. In smaller environments without a designated administrator, the integrated backup feature has the advantage that no extensive configuration needs to be performed in order to make sure that the backup is successfully completed and that all pertinent data and directories are included. To be able to transfer the data (for example to Digital Audio Tape), it is necessary to integrate the backed up data into another system backup.

When using external backup software (e.g. Symantec Backup Exec, Windows NTBackup or Acronis True Image,) a few measures have to be taken to be able to create a successful backup. However, it has the advantage that the MailStore Server data can be integrated into existing backup strategies without having to perform a separate system backup.

Which Data Must be Backed Up?

Each archive store in MailStore consists of three components:

  • Folder information and meta data
  • Email headers and contents
  • Full text index

While folder information and meta data as well as email headers and contents are a unit that requires consistency, full text indexes can be reconstructed if needed.

In addition to the archive stores, the MailStore master database (MailStoreMaster.fdb) must be backed up as well because it contains all configuration settings of the users and profiles.

Using the MailStore Integrated Backup Feature

MailStore has built-in technology to perform a full backup of the archive.

A full backup contains all archived emails and all program settings such as users and privileges. Restoring such a backup is sufficient to completely reinstate the original archive without having to perform any further configurations.

Important Notice: When using the integrated backup feature, MailStore only supports standard archive stores. If you are using advanced archive stores, a full backup can only be performed using external backup software.

Procedure

To create a complete database backup, proceed as follows:

  • Log on to MailStore Client as MailStore administrator.
  • Click on Administrative Tools > Management API and then Jobs.
  • Click on Storage and select Create Backup.
    Jobs create backup 01.png
  • Enter the target directory
    Please note: If the target directory is a network share, make sure that the MailStore Server service has access to that share. Further information are available in the Using Network Attached Storage (NAS) article.
  • Define the start time for the backup in the Schedule section.
  • Click OK to finish the creation of the backup job.

If necessary run the job manually in order to verify that MailStore Server is able to create a backup without errors.

Please note: The archive cannot be accessed while a backup is in progress. Trying to access the archive will generate the error message "Due to maintenance the server is currently unavailable."

Using External Backup Software

Backup of Standard Archive Stores

When backing up standard archived stores with an external backup software, attention must be payed to the consistency of data, which mainly depends on the backup method. The following sections summarize the pros and cons of the different methods.

File Based Backups

While file based backups solutions are good for backing up independent files, they are usually not suitable for creating consistent backups of MailStore Servers as their data is spread across multiple rapidly changing files.

In order to create consistent backups with file based backup tools, it is required to either freeze and thaw MailStore Server via net pause mailstoreserver and net continue mailstoreserver commands or to shutdown and restart the MailStore Server via net stop mailstoreserver and net start mailstoreserver commands.

As MailStore Server must remain shut down for the time of the backup, this typically results in downtimes during which MailStore is neither able to archive new email nor provide end user access to the archived data.

Storage Snapshots

When using Volume Shadow Services (VSS) or other methods of creating snapshots on storage level, it is necessary to ensure that all files used by the instances are closed before the snapshot is created.

The MailStore Server service provides external backup software using Microsoft Volume Shadow Service with a so-called Volume Shadow Service Writer (VSS Writer). The external backup software can use it to create consistent backups of the MailStore master database and all standard archive stores. Whether this method succeeds, however, largely depends on the backup software and the storage which is used. The VSS Writer has to be activated in the MailStore Server Service Configuration.

To verify if the appropriate VSS events were initiated in MailStore during a backup, open the system protocol in the Windows event viewer and search for the following events:

  1. A backup session has been started.
  2. The archive has been frozen as a reaction on the OnPrepareSnapshot event.
  3. The archive has been thawn as a reaction on the OnThaw event.
  4. The backup session has been shut down.


If these events cannot be found in the system protocol, no consistent backup using Volume Shadow Service was performed. In that case it is necessary, that the backup software is preparing MailStore Server for the snapshots. This can be done with the methods mention in File Based Backups.

To learn how to execute commands before and after performing snapshots, please consult your backup software's documentation.

Full Virtual Machine Snapshots

Some backup solutions are highly integrated into virtualization solutions and allow to create and backup/replicate full snapshots of virtual machines. These type of snapshots not only contain the current state of the hard disks but also of the current main memory. Thus full virtual machine snapshots can be considered as consistent.

Other Backup or Replication Methods

For questions regarding any other type of backup solutions such as block level replication, continuous backup, etc. please contact the vendor's support to find out whether their software is able to create consistent backups of whole directory structures.

Backup of Advanced Archive Stores

Advanced archive stores allow you to store individual components of the archive store data in different locations. For example, folder information and meta data can be stored in an SQL database while saving email headers and contents in the file system. Depending on the storage locations, the order can be crucial for a consistent backup.

Single Storage Location

If all data of an advanced archive store such as folder information and meta data as well as email headers and contents are stored in the same location (file system or SQL database), the consistency of this location must be kept in mind. This can be done using the Volume Shadow Service or appropriate database backup software, for example.

Multiple Storage Locations

In case different storage locations are used for folder information and meta data as well as email headers and contents of an advanced archive store, the order of the backup is crucial for the consistency of the archive store backup. Please adhere to the following order:

  1. Backup of the folder information and meta data
  2. Backup of email headers and contents


This ensures that upon recovery, for all folder information and metadata there exist the corresponding email headers and contents, and that data integrity is maintained.

Restoring Backups

This section describes how a database backup of the entire email archive, which was created using the integrated backup feature, can be restored.

Background

A database backup which was created using the integrated backup feature contains all archived emails and program settings such as users and privileges. Restoring such a backup is sufficient to completely reinstate the original archive without having to perform any further configurations.

Automatic Restore of a Database Backup

MailStore creates two files in the backup destination when creating a backup., which allow an automatic full restore of the archive in its original storage location. Should the backup be restored into a different storage location or if only parts (i.e. single archive store) should be restored, the restore procedure must be performed manually (see next section).

An operative installation of MailStore Server is required to restore a database backup. Please proceed as follows:

  • Stop the MailStore Server Service and remove the empty archive directory that has been created during installation in C:\MailArchive.
  • Next execute the file restore.bat from the backup directory.
  • Follow the on-screen instructions. Carefully check the output for possible error messages.
  • Run the MailStore Server Service Configuration tool from the MailStore program folder in the Windows start menu.
  • Click Browse... under General > Master Database and select the restore directory which contains the MailStoreMaster.fdb file. Confirm the selection by clicking OK.
  • Finally start the MailStore Server Service again.

No further steps are necessary after using the automatic restore.

Manual Restore of a Database Backup

An operative installation of MailStore Server is required to restore a database backup. Please proceed as follows:

  • Copy the database backup to a local hard drive on the computer or to a respective network share.
  • Start the MailStore Server Service Configuration. It is located in the MailStore Server program folder that can be accessed through the Windows Start menu.
  • Below Master Database, click on Browse... and select the backup directory containing the file MailStoreMaster.fdb.
    Bkup restore 01.png
  • Click on OK to confirm.
  • At the bottom of the window, click on Restart Service to save the new settings.
  • When creating the backup, the folder names of the archive store may have changed. Please use the Storage Locations Management to adjust the paths to the archive stores or rename the folders in the file system accordingly. 'Hint: A mapping of archive store folder names in the backup to their original names can be found in the restore.csv file that has been created with the backup.
  • The backup is completely restored to the application and the archive can be used as usual.