Unanswered: Using DMO to restore to new database and physical file
I have been trying to use DMO(C++) to backup a database and then restore from that backup to a new db name AND physical data and log files, with no success. I have been able to successfully restore the backup to the same database and change the physical file names using the RelocateFiles property on the Restore object, but not change both.
Any help would be greatly appreciated.
I tried the first link and the app has the same problem I ran into. The first database still exists on the server, so when I try to restore to a new db name, DMO reads the physical file location from the backup, which is the same as the physical file for the existing db. The "trick" i'm looking for, is how to change the physical file location in the backup, so there is no conflict on restore and essentially I end up with two copies of the same database on the same server.
I appreciate the link, though, gives me an introduction to using C# with DMO!