CrystalCMS
03-11-2009, 03:51 PM
Similar to the other application posted in this forum, here is a ASP.NET based backup solution for SQL 2008 db's using the new Sql2008CreateBackup API method.
This one is a Visual Studio 2008 solution / project but there's so little code in it, it will easily convert to earlier versions of VS if required. It's simple and a bit noddy to be honest but once installed and hosted in a DASP account, it can be easily be called directly from a DASP scheduled task.
Here are a few quick tips to get it working:
1) Enable the api for your DASP account
2) Put your apiKey in the web.config appSettings section
3) Put your apiSandboxKey in the web.config if you want to test with that
4) Put your databaseName in the web.config
5) Upload it as part of your main app in the root of your DASP account or alternatively in a separate sub folder off the root.
6) If uploaded to a sub folder, use the web application tool to create the web app for the sub folder
7) Create a scheduled job to call the default.aspx page. It looks like every 6 hours is the min threshold to call the Sql2008CreateBackup API method, but once or twice a day should be sufficient.
8) Add the IP address of the webserver your account is hosted on to the api whitelist
A couple of other things:
1) Any exceptions are trapped and handled but simply thrown and logged.
2) If you need exception notification setup (e.g. by email) you can just configure your own <healthMonitoring/> section in the web.config
3) Basic logging is performed to backupLog.txt using System.Diagnostic.Trace
That's about it - it's working well here.
Feel free to rip the code and use it as you please.;)
All comments and criticism very welcome..I'm sure there's room for improvement!
All the best,
Joe
This one is a Visual Studio 2008 solution / project but there's so little code in it, it will easily convert to earlier versions of VS if required. It's simple and a bit noddy to be honest but once installed and hosted in a DASP account, it can be easily be called directly from a DASP scheduled task.
Here are a few quick tips to get it working:
1) Enable the api for your DASP account
2) Put your apiKey in the web.config appSettings section
3) Put your apiSandboxKey in the web.config if you want to test with that
4) Put your databaseName in the web.config
5) Upload it as part of your main app in the root of your DASP account or alternatively in a separate sub folder off the root.
6) If uploaded to a sub folder, use the web application tool to create the web app for the sub folder
7) Create a scheduled job to call the default.aspx page. It looks like every 6 hours is the min threshold to call the Sql2008CreateBackup API method, but once or twice a day should be sufficient.
8) Add the IP address of the webserver your account is hosted on to the api whitelist
A couple of other things:
1) Any exceptions are trapped and handled but simply thrown and logged.
2) If you need exception notification setup (e.g. by email) you can just configure your own <healthMonitoring/> section in the web.config
3) Basic logging is performed to backupLog.txt using System.Diagnostic.Trace
That's about it - it's working well here.
Feel free to rip the code and use it as you please.;)
All comments and criticism very welcome..I'm sure there's room for improvement!
All the best,
Joe