Using Toolkit for Application Backup & Restore
pearsons_11114
Posts: 6
I would like to use the toolkit to enable a backup/restore capability for my application. It seems pretty straightforward just to follow the example for SQL Packager, just doing the data portion. However, what's not immediately clear is where to stop short of creating an executable package.
I'd like the backup to save the results of the data compare at some intermediate point. I'm just getting familiar with the API, so it's not clear to me yet where that would happen in the process. The restore would read this back in and execute the script. I'm sure I can eventually figure out the best way to do it, but I'm wondering if anyone else has done something like this.
I'd like the backup to save the results of the data compare at some intermediate point. I'm just getting familiar with the API, so it's not clear to me yet where that would happen in the process. The restore would read this back in and execute the script. I'm sure I can eventually figure out the best way to do it, but I'm wondering if anyone else has done something like this.
Comments
That's a bummer because this is one of the main reasons I bought the toolkit. I wonder why they would set it up this way? I can't think of a use for the packager portion of the API as it stands. The only thing it can do is create an executable. I guess that would be ok if not ideal, but you don't have any control over available options. In my case I want to predefine parameters such as which database will be used. I don't want users to have the option of creating a new database. Anyone actually using this part of the API for anything?
So, the remaining effort would be to APIize the template code.
Anyone wants to reach in and put an end to this flail-ex, I'm all ears. ;-)
The best solution I can think of to get at the compressed batches is to let Packager compile an executable and then use reflection to get the resources out of the output file with some kind of resource reader.
Presumably you'd want to run the batches at some point, so then you're stuck figuring out how to use the zlib.dll to uncompress them again.
It's a sticky situation either way.
It turns out that the ExecutionBlock can't be recreated. The constructor is private, and however it's done internally is not exported to the API. The thing that's strange is why the Packager authors did not opt for this approach. They certainly could have created methods to serialize and deserialize the ExecutionBlock. You end up with redundant code in the template for reading in and executing. Very odd.
Feedback here is that the API seems unnecessarily crippled, and a number of published methods are undocumented (e.g., AddBatch), so I'm not sure what they're doing in the API. Needs a little more time in the oven.
Are you trying to accomplish some sort of "snapshot" method to do a hybrid sort of incremental backup?