Create a clone
Creating an image is fundamental to creating a clone. The video below demonstrates how an image can be created from a database.
The following properties are set executing the command:
- The image will be created from the database DB1 on the instance SQLDB1.
- The same instance will be used to create/build the image.
- The image will be saved in the directory “\\sqldb1\psdatabaseclone\images”
- To get the latest data a full backup will be created at runtime
In the video a credential is used to authenticate to the database server (SourceSqlCredential and DestinationSqlCredential) and to authenticate to the share (DestinationCredential) where the image will be saved. These can all be different credentials but in this example the same credential was used.
The command executed in the video is the following
New-PSDCImage -SourceSqlInstance SQLDB1 -SourceSqlCredential $cred -DestinationSqlInstance SQLDB1 -DestinationSqlCredential $cred -DestinationCredential $cred -ImageNetworkPath \\sqldb1\psdatabaseclone\images -Database DB1 -CreateFullBackup