Skip to content

Conversation

andreasjordan
Copy link
Contributor

I now have a lab on azure with a domain and a client and two sql servers to test the Copy-Dba* commands in a better scenario.

I changed the instances that are used in the tests so that we always copy from instance2 to instance3. This way I only need two instances in that lab.

All Copy-Dba* tests run successful in that lab.

@niphlod
Copy link
Contributor

niphlod commented Sep 11, 2025 via email

$results.Status.Contains('Skipped') | Should -Be $true
$results.Notes.Contains('System login') | Should -Be $true
# Notes is "Local machine name" if ComputerName is different, so we skip the test in this case
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change that is really needed to support instances on different computers.

@andreasjordan
Copy link
Contributor Author

@niphlod You are right - this PR is (mostly) useless and I was just to lazy to setup three instances. I commented the only part that is not only about changing the instance to test.

I will probably close this in the next days...

@andreasjordan
Copy link
Contributor Author

@niphlod on Slack: "The old motto was given dbatools is often used for migration, to test at least the "first" version that is currently out of support (e.g. in order to make sure dbatools works for people having environments to migrate given a version is in the need to be upgraded to a newer one)."

My idea:

Let's have two more "pointers" to instances in the $TestConfig: $TestConfig.SourceInstance and $TestConfig.DestinationInstance (like we name the SqlInstance parameters in those commands) and only use them in all the Copy- tests. Then we can use the olderst instance as source and the newest as destination.

We could start with using instance2 (SQL2016) as source and instance3 (SQL2017) as destination. Every test should pass. Then we can change source to instance1 (SQL2008R2) and see if every test works - without changing the test, only the global test configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants