Hey @FriedrichWeinmann, would you be able to take this one along with any other internal/external commands it would produce?
If so, would it be done by our feature freeze date of March 1?
Had started work on this, but as it relied on the restore stuff being in I've not gotten much further than this - https://gist.github.com/Stuart-Moore/19e730d58e4c91d8ef753663ac8488fb
Should call itself recursively if any log backups happen while it's restoring stuff.
If it's of use happy to push the branch up.
Look at that! totally is, @Stuart-Moore
This MSDN page has a lot of bad, but can be gutted for parts, perhaps.
I'll have look into it first, before I can commit to being able to do it in the timeframe. Will have more info tonight, possible tomorrow morning.
Question: Why would we call this New-DbaDatabaseMirror when technically mirroring is on the depreciation list with Microsoft? Why not use this for setting up an Availability Group?
Or if we are going to keep it at the current name, what will we call the one for preparing a replica and the databases to setup an AG?
The AGs can be built on top of/in conjunction with New-DbaDatabaseMirror. I believe it's Log Shipping that's deprecated (but that's still on my todo list because people still use it specifically for migrations since it's not edition dependent like mirroring.)
That reminds me, I believe that Mirrors require the same editions so we'll need to ensure they match/do further research.
I actually suck with AGs and don't know the steps and thus the words. But in looking at Microsoft's module, it looks like we can do more of the work for ppl (I dont want to support stuff to their granularity -- I'd rather us be the wizard)
OH NO, log shipping ain't going anywhere. Mirroring was added to the list with SQL Server 2012. Log shipping will be around forever, only way you can do DR in some situations.
With regards to version they do not have to be the same. You can have a principal be at 2008 R2 and the mirror at 2012...this is common practice for doing online migrations. The thing you do need to check is the Edition, for it to be supported by Microsoft they have to be on the same Edition. Reference
I have used code with SQLPS or SMO to build out an AG, already have it scripted for work actually when I do builds for clients. I know Thomas Stringer posted how to do it with SMO on Scripting Guy Blog...which that is one big a$$ picture of him on that post :) I'm working on taking his code to improve what I have written for work.
Alright, as promissed, I checked:
I should be able to do this within the limit with a safe margin.