Script out existing db mirroring setup

Hi Guru

I have database mirroring enabled on one of database, now i want to script it out the whole setup so that i can rerun script to enable it back, please guide me how i can do this

Thanks in advance

This is going to be challenging to do.

  • You can script the Endpoints using SSMS.
  • You really can't script the actual process to start mirroring on a database that isn't mirrored. That usually involves a backup, restore and then enabling mirroring on both sides. Better to write a script that does it.

Sorry, it's just not that simple.

Hi Graz

Thank you for the reply and insight to the problem, I keep my finger crossed and hope will find out the solution.

Cheers!
Shekhar