Sql-server – Resume Logshipping after Primary database restored

disaster recoverylog-shippingsql-server-2008

We have Database (D1) as a primary database and Log shipping setup to the secondary database called (LS_D1). Now what we are doing is taking backup of D1 database and restore it on D2 database. We do schema and data changes for new Release deployment on to D2 database.

What we want is to restore D2 database on D1 database and resume the log shipping to the LS_D1 database without copying backup file. Copying a backup file from primary data center to DR data center cost us too much money for every Release so that's why we want to resume the Log shipping.

When i tried to do this LSN numbers got out of sync, is there any way that we can solve this problem ? or can we have any other alternative to Log Shipping that can provide us DR capability and solve this problem ?

Note: Any solution that can require one time cost of log shipping would also be fine.

Thanks,
Piyush Patel

Best Answer

When you restored the primary the log shipping has broken. The only way to resume it is to re-initiate it, with a new full backup. End of discussion.

We do schema and data changes for new Release deployment on to D2 database.

And that is your real problem. Do all changes as code changes and deploy by running deployment scripts. When you want to migrate the changes done in development on D2 to D1 simply run the migration scripts on D1. Use Visual Studio Database Projects for instance.

Even w/o proper development process you could had applied the changes between D2 and D1 as scripts run on D1, and don't break the log shipping relation. Eg. tools like Red Gate SQL Compare and Data Compare would had done the job.