Using the Masstransit Backup Application on Windows
Total Page:16
File Type:pdf, Size:1020Kb
Using the MassTransit Backup Application on Windows 5/7/2018
Group Logic Technical Support
This Technote describes how to configure and use the Windows Backup Application in order to automate the backup of MassTransit Professional and Enterprise files and databases.
What the Backup Application does The Backup Application backs up MassTransit files and databases to a separate directory – these archives can later be used to restore MassTransit in the event of a database failure, or to revert the state of MassTransit to any previously backed-up state. In order to gain access to files and databases that are locked by MassTransit while it is running, the backup application shuts down MassTransit, copies the files, and then re- launches MassTransit. The backup application will not shut down MassTransit if there are any active file transfers. Backups are stored in a configurable directory – this directory can be on the MassTransit server’s physical drive, on a different drive, or even on a (mounted) network volume. Backups can be stored in a directory containing the date and time of the backup, so backups on different dates can be easily distinguished.
Installation All Backup Application files should be extracted into a single directory. The only other installation step is to register ntsvc.ocx – to do that, execute the following command on the command line (while in the Backup Application directory): regsvr32 ntsvc.ocx Restart the machine after running this command to ensure that the MTBackup service can be configured successfully.
Configuration - the backup.ini file Configuration parameters are stored in the backup.ini file: [Directories] ; Folder containing the MassTransit application MTFolderPath = C:\Program Files\MassTransit
; Destination folder for the backup files MTBackupPath = C:\Program Files\MassTransit\Backup
[Parameters] ; Minutes between retries (the script will check every NumMinutes to ; see if there are no active transfers) NumMinutes = 1
; Maximum retries before aborting MaxRetries = 10
; True if backed-up files should be placed inside a timestamp ; folder. False if the backed-up files should be placed directly in ; MTBackupPath above. ; Note that if this parameter is set to false, previous backups will ; be overwritten. UseTimestampFolders = True There are five configurable parameters: 1. MTFolderPath – This is the folder containing the MassTransit application that will be backed up. Some examples of valid values for this parameter: C:\Program Files\MassTransit D:\MassTransit \\Computer\Volume\MT [a remote (mounted) volume] 2. MTBackupPath – This is the destination directory – the backed-up files will be placed within this folder (inside a timestamp folder). Some examples of valid values for this parameter: C:\Program Files\MassTransit\Backup [on the same drive as the MassTransit installation] D:\Backup [on a different drive] \\Computer\Volume\Backup [a remote (mounted) volume] 3. NumMinutes – The backup application will not shut down the MassTransit application if there are any active transfers. This parameter indicates the number of minutes the backup application will wait before retrying. This value should be an integer value of at least 1. 4. MaxRetries – The maximum number of retries the backup application will attempt before it aborts the backup. This value should be an integer value of at least 1. 5. UseTimestampFolders – If this value is set to True, the backup application can place the backup files inside a unique timestamp folder within the MTBackupPath. If the value is set to False, the backup files will be placed directly in the MTBackupPath and will overwrite previous backups to this location.
Running the Backup Application The Backup Application can be run in two primary ways – manually, and via the Windows Task Scheduler – and against MassTransit running both as an application and as a service. In order to backup MassTransit when running as a service, you may run the Backup Application as an application or as service. To install the MassTransit Backup Service, launch the InstallBackupService.bat batch file. Running the Backup Application manually is simple – to backup MassTransit running as an application, launch the RunBackupApp.bat batch file, and to backup MassTransit running as a service, launch the RunBackupService.bat batch file.
Running the Backup Application via the Windows Task Scheduler allows the Backup Application to be automatically executed in a scheduled manner, such as once a day or once a month. The Windows Task Scheduler can be found in the Windows Control Panel as “Scheduled Tasks”. Simply point the Scheduler to the RunBackupApp.bat or RunBackupService.bat batch files as needed.
Using the Backup Application and Keep MT Alive script On Windows, the Backup Application and Keep MT Alive script can not be used at the same time. If the Backup Application runs while the Keep MT Alive script is configured, Keep MT Alive can start MassTransit in the middle of the backup process and the MassTransit databases can become corrupted.