Changing the LISTENER_IP address in a database mirroring configuration

This question came up today: how can I change the IP address between the principal and mirror in database mirroring?

Not a common operation but this procedure worked in an isolated lab environment where we had full control over the application and transaction activity.  We wanted to introduce a WAN latency injector so needed to change the database mirroring IP addresses on the principal and mirror. 

  1. Stop application activity
  2. Remove mirroring (SET PARTNER OFF)
  3. Stop Mirroring endpoints (on principal and mirror)
  4. Alter Mirroring endpoints to use new IP addresses e.g. ALTER ENDPOINT SET LISTENER_IP =
  5. Start endpoints on principal and mirror
  6. Enable mirroring (ALTER DATABASE <dbname> SET PARTNER = TCP://x.x.x.x)

I’ll try and find the exact scripts we used and upload them here.