Sql-server – Replication DB move

replicationsql serversql-server-2008-r2transactional-replication

I have 2TB of DB involved in SQL Server transactional replication. I want to move publisher DB files to a newer disk with minimum amount of downtime and without breaking replication. Please let me know if this is possible or not. My DB is on SQL Server 2008 R2 EE edtion. Please let me know if you need any further details.

Best Answer

If downtime needs to be minimized, then utilize native SQL full, differential and log backups and restores to the new disks, with NORECOVERY for the restores, and a different DB name. This is the same as moving the database to a new server (you just have to use an alternate temporary name for the db). During your eventual downtime, stop applications and all repl jobs, perform a tail-of-the-log backup of the existing DB, restore with recovery on the new DB. Dettach the old DB, rename the new db to the orignal db name, reset DBO (and trustworthy, clr and service broker if they were enabled on the original), restart the reply jobs.