- SQL Server database to image and eventually clone
- SQL Server instance to build the image. This can be the same as the source instance.
- A network share to save the images to.
Creating the image
The following command will create an image on the same instance that hosts the source database.
The image will be saved in the file share “\\sqldb1\psdatabaseclone\images” and during run-time a full backup will be created to get the latest data.
New-PSDCImage -SourceSqlInstance SQLDB1 -SourceSqlCredential $cred -DestinationSqlInstance SQLDB1 -DestinationSqlCredential $cred -DestinationCredential $cred -ImageNetworkPath \\sqldb1\psdatabaseclone\images -Database DB1 -CreateFullBackup