microsoft / sqlmanagementobjects

Sql Management Objects, an API for scripting and managing SQL Server and Azure SQL Database
Other
130 stars 21 forks source link

Feature Request - Replication on Core #59

Open potatoqualitee opened 3 years ago

potatoqualitee commented 3 years ago

Replication is useful for people doing DR to Azure. We're looking to add more replication commands to dbatools and having it available on Core/Linux would be helpful. Right now, we can import the DLLs on Core but get this error in Core that we do not in Desktop.

Cannot find an overload for "ReplicationServer" and the argument count: "1".

$sqlconn = New-Object System.Data.SqlClient.SqlConnection $connstring
New-Object Microsoft.SqlServer.Replication.ReplicationServer $sqlconn

We also have to use the classic System.Data instead of Microsoft.Data

potatoqualitee commented 3 years ago

Update: Nevermind, it just worked because I had SSMS installed on all of my test machines 😅 If we could have it for Core and SMO 16, that'd be appreciated.

potatoqualitee commented 2 years ago

We'd still love this feature if possible 😇

shueybubbles commented 2 years ago

Do you have a list of which DLLs you need? Moving them from their current source repo to the SMO source repo is non-trivial but I may be able to staff such an effort late this year as part of the "open source SMO" effort.

potatoqualitee commented 2 years ago

Sweet!

Microsoft.SqlServer.Rmo.dll
Microsoft.SqlServer.Replication.dll
Microsoft.SqlServer.ReplEnum.dll
johlju commented 2 years ago

Really looking forward to get those assemblies into this project too.

potatoqualitee commented 2 years ago

I'm guessing if this request is completed, an official Replication Nuget for .net framework will also appear? 🙏🏼

potatoqualitee commented 2 years ago

I got it working for Windows and Linux! had to do some DLL redirection but Replication and RMO is working with the latest libraries. I had to copy it from a SSMS 19 install though. Can yall package it in a nuget? (And if it can be updated to the latest SMO, that'd be great, if not, I'll do a nuget)

shueybubbles commented 2 years ago

I think you have to be careful about licensing when copying DLLs from a SQL installation. The SMO nuget has its own redistribution rules compared to a box install. I don't own the repl components so it's difficult to make progress on getting them extracted as an SDK.

potatoqualitee commented 2 years ago

Thank you for the warning. Fortunately, I asked the SQL Server team and have permission to do so in writing.

potatoqualitee commented 2 years ago

Dang, I suppose I can build in an auto-extraction from the binaries. That'll be fun at least? 🤷🏼 🤣

willibrandon commented 1 year ago

Please help me understand. Are Replication Management Objects (RMO) currently open source? Would fulfilling this request involve open sourcing Replication Management Objects?

willibrandon commented 1 year ago

I don't own the repl components so it's difficult to make progress on getting them extracted as an SDK.

@shueybubbles - I would be very interested in this.