Skip to main content

SQL Server Mirroring and Replication - Replace The Mirror

So, as with most technical "support" available a Google search away, the literature about SQL Server Replication and Mirroring is mostly inaccurate and, worse yet, in some instances it will cause you significant data loss and heartache.

This small mini series uncovers the truth about SQL Server and how mirroring and replication interact. I understand that mirroring has been deprecated for AlwaysOn Availability Groups - I'm sure I'll have something to say when I do one of those migrations.

Anyway, I recently had cause to do a hardware refresh on a SQL mirror pair that was also configured as a replication publisher. In this instance, for reasons I don't fully remember, I provisioned a new mirror server, made sure the SQL version and patch level matched, broke the original mirror and re-established it to the "new" mirror hardware.

And this worked fine. All you need to remember to do is update the replication Log Reader Agent and Snapshot Agent's -PublisherFailoverPartner agent parameter to the new mirror's hostname and all is well.

Note however that if you do choose this method to replace the mirror partner, you absolutely MUST NOT do as the Microsoft Guide says in Step 3 of their guide, and that is -


execute sp_adddistributor at the mirror
If you do this, when there is a publication already up and running, you will DESTROY REPLICATION. The time to run sp_adddistributor at the mirror is in a new environment where you are just setting up mirroring and publications. The Log Reader Agent will still work without doing this, in a failover scenario. And practically, failing over to the mirror is a temporary thing - it's unlikely you have your SQL jobs etc set up to run on both. So you will never be on the mirror for an extended period of time and if the log reader is churning away, happy days.

And because replication is so reliant on the NetBIOS names of the publisher, distributor and subscribers, you can't practically perform much replication maintenance while on a mirror server either, as apart from the agents that support the failover partner parameter (because they are using the ADO driver for a connection) , most operations will be looking to the publisher do anything, and it will be offline or the database will be in recovery mode.

One caveat here - if you did setup your mirror and publications correctly in the first place, you could, instead of replacing your mirror with a new machine with a new hostname, simply do a "DR" style replacement of your mirror by restoring the master and msdb databases and copying the mirrored databases files over. This is the method I used to replace the mirror master and publisher of this setup and will be covered in my next article.

Comments

  1. Streetwear enthusiasts closely follow Denim Tears during festive periods. The official site showcases limited designs that feel relevant and expressive.

    ReplyDelete
  2. Holiday wardrobes usually focus on versatile outerwear pieces. The Corteiz Windbreaker fits well into discussions about everyday winter fashion.

    ReplyDelete
  3. Not gonna lie, the prices are on the higher side, but the quality and messaging behind Broken Planet make it feel more like an investment piece than fast fashion.

    ReplyDelete
  4. If you’re shopping for a Valentine who’s into fashion, Eric Emanuel shorts are a solid choice. The quality and fit really stand out.

    ReplyDelete
  5. Le Lis Clothing brings a soft and elegant approach to seasonal fashion. Valentine’s Day is the perfect moment to explore cozy yet stylish outfits. Many fashion lovers appreciate how the brand balances comfort with modern design. Holiday styling becomes easier when pieces feel wearable and expressive. Le Lis Clothing fits naturally into winter celebrations without feeling overly commercial.

    ReplyDelete
  6. Fashion reps are great for experimenting with trends you’re not ready to commit full retail prices to.

    ReplyDelete
  7. Dragonfruit is sweet and perfect for Valentines Day. I love cutting it in small pieces. It tastes amazing with chocolate.

    ReplyDelete
  8. One downside of online shopping is sizing, but detailed reviews and size guides really help.

    ReplyDelete
  9. I tried this SMM panel and it worked really well. My social media accounts grew quickly. It is a great Valentine's Day tool.

    ReplyDelete
  10. SMM seguidores makes social media growth simple. I enjoy seeing the daily progress. Valentine's Day vibes are so fun.

    ReplyDelete
  11. The key with panel sosmed is consistency—when used properly, it can support overall branding and visibility.

    ReplyDelete
  12. If you’re planning to visit g59merch.net for Valentine’s Day threads, do your homework first. Some fans warn that not all online merch sites are official, and it can be hard to tell what’s legit and what’s not.

    ReplyDelete
  13. Wearing this Corteiz hoodie made my Valentine’s Day date feel extra stylish and comfortable because I didn’t have to worry about the cold. The design stands out and makes me feel confident every time I walk into a room. This hoodie has quickly become a staple piece I want to wear all the time.

    ReplyDelete
  14. Essentials like these are always a good idea. They balance comfort with style perfectly. I want to get them before the holiday.

    ReplyDelete
  15. I love wearing SDL shirts for special occasions. This one is perfect for Valentine's Day. It makes me feel confident and happy.

    ReplyDelete
  16. Ich war beim Online-Kauf von Pullovern immer skeptisch, aber nach diesem Beitrag fühle ich mich deutlich sicherer. Werde eure Tipps beim nächsten Einkauf definitiv umsetzen!

    ReplyDelete
  17. Awful Lot has really outdone themselves The Valentines Day collection is stylish and fun I love how unique it feels

    ReplyDelete
  18. Kupiłem swoją przez polski sklep online i jestem mega zadowolony — materiał jest gruby i solidny, a design wygląda jeszcze lepiej na żywo niż na zdjęciach. Idealna na jesień i zimę, a do tego świetnie komponuje się z jeansami i sneakersami. Polecam każdemu, kto lubi streetwear z charakterem!

    ReplyDelete
  19. Everyone should try Essentials T-shirts. They are simple but very trendy. I wore mine on Valentine’s Day and felt great.

    ReplyDelete
  20. Pokemon t-shirts are a great choice for gifts. My partner loved it this Valentine. Shopping online is so convenient.

    ReplyDelete
  21. Lattafa men perfume gives a fresh feeling all day. It is ideal for evening dates. I recommend it to everyone.

    ReplyDelete
  22. Każdy model z kolekcji Stone Island zachwyca detalami. Projektanci naprawdę wiedzą co robią. To trafiony prezent na Walentynki.

    ReplyDelete
  23. Every time I wear my Comme des Garçons jacket, people ask where it’s from. The details are subtle but unmistakably CDG — it’s like wearing a piece of fashion art. I pair mine with basics so it really stands out. Would love to see more seasonal colorways released!

    ReplyDelete
  24. I’ve been following Trapstar for a while and their tracksuits consistently stand out. The quality is impressive — the stitching feels sturdy, the fabric is soft but durable, and the fit is just right. I love how the designs blend streetwear edge with comfort. Whether I’m heading out or just chilling, it’s become my go-to outfit. Definitely worth the investment if you’re into bold, urban style!

    ReplyDelete
  25. Great post on Alchemai sweatpants! I like how the brand focuses on fit and detail—it really shows in their designs. This is the kind of streetwear piece that works in any wardrobe without trying too hard.

    ReplyDelete
  26. One thing I always appreciated about Sean John apparel was the quality. The fabrics and construction felt premium compared to a lot of other streetwear brands at the time.

    ReplyDelete
  27. Godspeed sweatshirts are perfect if you want something that feels both trendy and comfortable. The designs have a motivational vibe that really connects with hustle culture.

    ReplyDelete
  28. Happy memories do not fade with time. Valentines Day makes them feel alive again. Love always finds a way back.

    ReplyDelete
  29. I love listening to Fugazi on Valentine’s Day. Their music makes my heart feel full. It is perfect for sharing with someone special.

    ReplyDelete
  30. I love how Ktwo Studios mixes fashion and fun Their items are perfect for gifting This Valentines Day will be memorable

    ReplyDelete
  31. The craftsmanship on this hoodie really caught my attention. From fabric choice to fit, everything feels intentional and well-made. It’s clear that this piece represents the true spirit of the Kapital clothing collection.

    ReplyDelete
  32. SDL Clothing has the perfect Valentine’s collection. The outfits are cute and trendy. I am planning my look already.

    ReplyDelete
  33. Shopping at Valeforever is always fun. Their Valentine’s Day items are irresistible. I bought a gift for my best friend.

    ReplyDelete
  34. I really love the creativity behind the Takashi Murakami hoodie designs. The colors are vibrant and the artwork instantly stands out, making it feel more like wearable art than regular streetwear. It’s amazing how Murakami blends Japanese pop art with modern fashion. Definitely a must-have for anyone who appreciates unique hoodies.

    ReplyDelete
  35. Huge fan of the Corteiz hoodie collection! Every release brings something unique, and the attention to detail is noticeable. Whether you’re going for a simple look or something bold, there’s a hoodie here for everyone. Streetwear at its best!

    ReplyDelete

Post a Comment

Popular posts from this blog

Log Reader Error On Adding Subscription

Ever tried to add a new subscription to an existing publication, using the "replication support only" or "initialize from backup" methods and go the following error? The process could not execute 'sp_MSadd_replcmds' on <'Distribution Server>'. (Source: MSSQLServer, Error number: 1007) Conversion failed when converting the nvarchar value '.' to data type int. (Source: MSSQLServer, Error number: 1007) Batches were not committed to the Distributor. (Source: MSSQL_REPL, Error number: MSSQL_REPL22020) The last step did not log any message! (Source: MSSQL_REPL, Error number: MSSQL_REPL22037) If so, you will know the internet is absolutely useless, filled with worthless workarounds or advice to just "rebuild replication" Well, if you want an actual solution, just read on. Between SQL 2012 RTM and SQL 2012 SP4 there was a change made to the Distributor proc sp_MSadd_replcmds. This change was to facilitate a change in the format...

SCCM 2012 - SMSPXE Error

I write this to help all you technical warriors out there who get shitty advice from the Microsoft Forums and other profound idiots about the 0x80092002 error in SCCM - usually to do with PXE booting but can manifest in other ways around DP -> MP communications. The tricky one about this error is that it happens even if you are only using HTTP communication and not HTTPS/TLS. So to get an error about certificates is somewhat confusing. What the uneducated masses of the internet will tell you is to re-install the PXE role over an over. This will do nothing. Then they will tell you to re-install your management point and effectively re-build your entire infrastructure. This will  work, but only because it is the nuclear option and will run the step that actually makes a difference as a matter of course. So, here it is folks. If you have these kinds of errors in your logs: PXE::MP_InitializeTransport failed; 0x80092002 SMSPXE 22/03/2017 2:45:58 PM 4144 (0x1030) ...

Writing to the event log in .NET - the right way

As a DevOper, I spend a lot of time instrumenting code. This involves adding stuff like performance counters, tracing and logging. One thing that constantly irks me when I go looking for ways or means to improve how I do my logging, is the complete and utter misinformation and misuse of the Windows Event Log. The problem relates to the canonical implementation of logging in .NET, log4net. Look at this method signature: void Info(object message); Note the lack of structure, the lack of context. Note the ability for a developer to put absolutely anything into the message object (which will be outputted as a string). When these types of messages are hooked up to an Event Log sink, the result is a generic message, usually in the Application log with a bit of free form text. Fairly useless for anyone to be able to filter and report on. The above style of logging is really more suited towards tracing and debug logging than actual operational logging, Why you should write operatio...