Skip to content
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

Copy-DbaDatabase -SetSourceReadOnly -Force Doesn't force the read-only #5055

Closed
5 tasks done
maddhatter opened this issue Feb 6, 2019 · 0 comments · Fixed by #5057
Closed
5 tasks done

Copy-DbaDatabase -SetSourceReadOnly -Force Doesn't force the read-only #5055

maddhatter opened this issue Feb 6, 2019 · 0 comments · Fixed by #5057

Comments

@maddhatter
Copy link
Contributor

Before submitting a bug report:

  • Ensure you are able to reproduce it on the latest released version (we release often)
  • Verified this bug is not already reported in an issue
  • Verified errors are not related to permissions
  • Can reproduce in a clean PowerShell session (clean = powershell -NoProfile)
  • If issue is with Copy-DbaDatabase, using Backup-DbaDatabase | Restore-DbaDatabase still does not work

Note that we do not have the resources to make Copy-DbaDatabase work in every environment. Instead, we try to ensure Backup & Restore work in your enviornment.

Steps to Reproduce

/*
    Any T-SQL commands involved or used to produce test objects/data.
*/
<#
A database has an open transaction
#>
Copy-DbaDatabase -Source $source -Destination $dest -SharedPath $share -BackupRestore -AllDatabases -WithReplace -SetSourceReadOnly -SetSourceOffline -Force

Expected Behavior

Since the -Force switch was specified, that the source database would be set read-only forcefully (via Set-DbaDbState -Readonly -Force / ALTER DATABASE xxx SET READ_ONLY WITH ROLLBACK IMMEDIATE

Actual Behavior

Database is skipped.

Environmental data

  • PowerShell:
    • SQL Server:
@maddhatter maddhatter changed the title Copy-DbaDatabase -SetSourceReadOnly-Force Doesn't force the read-only Copy-DbaDatabase -SetSourceReadOnly -Force Doesn't force the read-only Feb 6, 2019
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 a pull request may close this issue.

1 participant