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

Creating image of a current database without copying to a new database first #192

Open
blitzmann opened this issue May 2, 2022 · 0 comments

Comments

@blitzmann
Copy link
Contributor

blitzmann commented May 2, 2022

The way that I understand the imaging process is this:

New-DcnImage will use a backup file (either provided, or using whichever one is the last one of the source database) to restore a database on the destination sql server. This restoration will use image paths to the mounted VHD for the data and log files, so that the restored database goes into the virtual disk. Once the restore is done, the VHD is dismounted and the database dropped.

So the database that is created on the destination server is simply a surrogate for the image creation process.

Is there any reason that the data and log files can't simply be copied directly to the VHD? I understand copying them while the database is active might not be a great idea (and perhaps this is why using a "backup" might be preferred, because those can be done online), would it be possible to add a flag to New-DcnImage to offline the database first, copy the files, and then online it? It just seems this would be a more direct way for those situations that would allow for it. I'm primarily a developer, not a dba, so I don't know if there are other considerations that I'm missing as it relates to restoring a database over copying the files.

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

No branches or pull requests

1 participant