WebServerBackup

Auto Backup DNN Website files, data and copy to Azure Storage

What is WebServerBackUp

WebServerBackUp is a console application designed to run from the windows task manager or manually activated. It is designed to backup all the files required by DNN Websites on the server and make a versioned (snapshot) history of these files on Azure Storage.

Setup

Run the "WebServerBackup.msi" install fie on the server. This will load all required files into the "C:\Program Files (x86)\WebServerBackup" folder.

Edit the "WebServerBackUp.exe.config" file in that folder to activate the options and to set the correct settings. By default all options are set to "false", to activate an option set the relative setting in the config file to "true" and add the required parameters.

Setup Task

After the WebServerBackup is installed you can setup a windows task from task Manger to run the backup/check each night.

Don't forget to make sure that the task is ran even if the user is not logged in.

Task Manager
Task Manager
Task Manager

Functions

BackupDB();

Creates a backup of ALL user databases in a SQL server instance. And then zips these into a single zip file.

BackupWebSites();

Searches for any subfolder from the root folder provided, that contains a "Default.aspx" file. All sub-folders containing a "Default.aspx" will be zipped into individual sub-folder named zip files.

NOTE: A known issue is that any zip file of 4GB will be corrupt. We're working of a solution to split the zip file to stop this happening.

IISSettings();

Makes a copy of all IIS settings and zips them

IISlogFiles();

Clears all IIS Logs files older than the date given.

CopyToAzure();

Copies all the backup files to Azure and makes a snapshot.
Any snapshots older than the given retension time will be deleted. The retension time of snapshots made on the 1st of the month is set to 32 days.

ResultFile();

Sends a results file to the azure container, indicating if the backup was successful, this can be checked to ensure the backup has worked.

CheckBackup();

Checks the result file created by the backup and sends an email to notify of success or failure. This process will search all containers for a result file and send a single email with a summary of results.

This function can be ran from an independant server and will check all containers in the storage container specified in the settings. Therefore you only need run this once for all servers that have been backed up.

Helpful Links

Explorer to deal with snapshot downloads and management.
http://www.red-gate.com/products/azure-development/azure-explorer/

https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs