Skip to content

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

@blitzmann

Description

@blitzmann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions