Backing up any site is critical. Call it disaster recovery or just good practice, creating a snapshot of your application always pays off. The process must be simple and easy to do; else people won't do it. You also need to know how to use the backups to recover. How many times have I went in to help out a company only to find out that they never tested their backup process. Manager
Sb2DevelopersBlog provides a solution that works for me. It's a simple Backup Manager for BlogEngine.NET in order to perform a full backup (backs up the entire site). It only supports the XML Based DataStore so you are on your own for database backups.
Here is the Steps in order to make this working:
- Put the "Admin/BackupManager" Folder to your "Admin" Folder.
- Put the "App_Code/BackupManager" Folder to your "App_Code" Folder
- Copy the ICSharpCode.SharpZipLib.dll to your "Bin" Folder
- Create an Empty "Backups" Folder into "/App_Data"
Then make the Following changes in Web.sitemap and Web.config
Web.Sitemap
<siteMapNode url="~/admin/BackupManager/Default.aspx" title="Backup Manager" description="" roles="administrators"/>
Web.Config
<httpHandlers><add verb="*" path="backup.axd" type="BackupManager" validate="false"/></httpHandlers>
Update 5/2 !!
Yes, you must test your backups. One item I found was that the zip file could not be unzipped using Windows XP. After some searching, there are some issues with Win XP not supporting Zip64. If your site is under 4GB, you can turn off Zip64 in add_code/BackupManager/BackupManager.cs – ZipFiles method:
ZipOutputStream oZipStream = new ZipOutputStream(File.Create(outputPathAndFile));
oZipStream.UseZip64 = UseZip64.Off;
Another recommendation was to use the CleanName function to help out XP in the ZipFiles method:
oZipEntry = new ZipEntry( ZipEntry.CleanName(Fil.Remove(0, TrimLength)));
oZipStream.PutNextEntry(oZipEntry);
Finally, when sending the zipfile: clean headers, set contentType in the ProcessRequest method:
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/zip";
Here is the version I used for this post:
BE.N.BackupManager.rar (73.48 kb)
Here is my updated BackupManager.cs
BackupManager.cs (3.68 kb)