-
-
Notifications
You must be signed in to change notification settings - Fork 854
Start-DbaMigration - Add -SetSourceOffline to set databases offline during migration #10013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
…uring migration This enhances the -SetSourceOffline parameter to work like -SetSourceReadOnly, setting databases offline BEFORE migration begins (not after) to prevent any connections to source databases during the migration process. Changes: - Start-DbaMigration.ps1: Added parameter and documentation - Copy-DbaDatabase.ps1: Modified to set offline before migration, online on destination - Tests updated to include new parameter in validation (do Start-DbaMigration, Copy-DbaDatabase) Co-authored-by: Chrissy LeMaire <potatoqualitee@users.noreply.github.com>
|
@claude add an integration test |
|
Claude finished @potatoqualitee's task —— View job Integration test added for -SetSourceOffline
Summary of changes: Test added:
The test creates a dedicated test database, migrates it with |
…eter (do Start-DbaMigration) Co-authored-by: Chrissy LeMaire <potatoqualitee@users.noreply.github.com>
|
@claude hullo pls fix the test failures Path : Start-DbaMigration/When using SetSourceOffline parameter/Should set source database offline before migration and bring destination online |
|
Claude finished @potatoqualitee's task —— View job Test failure fixed
Issue found: The test was using Fix applied:
The test will now properly validate that |
(do Start-DbaMigration) Co-authored-by: Chrissy LeMaire <potatoqualitee@users.noreply.github.com>
|
@claude failed tests ls_messages_and_errors.xml.zip (26,876 bytes)...100% |
|
Claude finished @potatoqualitee's task —— View job Test failures fixed
Root cause: Fix applied: Modified
The function now properly returns database migration results for test verification while maintaining all existing functionality. |
… verification (do Start-DbaMigration) Co-authored-by: Chrissy LeMaire <potatoqualitee@users.noreply.github.com>
Updated the role filtering logic in Copy-DbaServerRole to exclude the 'public' role in addition to fixed roles. This prevents unintended copying of the 'public' role to the target server.
Enhanced test setup and cleanup to handle offline databases and cross-platform backup paths. Added robust cleanup using T-SQL, improved backup directory handling for Linux/Docker, and refactored tests to ensure accurate migration and status checks. Also updated exclusions and variable usage for clarity and reliability.
SetSourceOffline is now applied before detach for DetachAttach and after backup for BackupRestore to ensure proper connection handling. Added integration tests to verify offline state after migration and cleanup logic for offline databases. (do Start-DbaMigration)
Enhances the -SetSourceOffline parameter to work like -SetSourceReadOnly, setting databases offline BEFORE migration begins (not after) to prevent any connections to source databases during the migration process.
Closes #9156
Generated with Claude Code