dbaclone
dbaclone copied to clipboard
Warning when using New-DcnImage -ImageLocalPath: Please enter the network path where to save the images
Describe the bug When trying to create an image, using the example:
New-DcnImage -SourceSqlInstance SQLDB1 -DestinationSqlInstance SQLDB2 -ImageLocalPath C:\Temp\images\ -Database DB1 -CreateFullBackup
I get the following error:
WARNING: [16:36:04][New-DcnImage] Please enter the network path where to save the images
To Reproduce Ran the above example from the documentation, substituting my own values of course.
I've had a look and resolved the warning, but I've run into some logic I'm not sure about. The logic here tries to convert the Network Path into a local path, which is already provided. I'm unsure if it should be doing the opposite to determine the network path or skip the network path completely.
Yeah I also looked and couldn't make out what it's supposed to do. Part of me thinks it's supposed to represent the local path with respect to the server... but who knows.
When I developed the module there was some challenges when creating the images over network paths. That's the reason I convert the network path to a local path. It is the local path of the server/computer where the images are saved
And that kind of makes sense, but the example still doesn't work out of the box. I also believe that should be clarified in the documentation :)
just hit the same issue just trying to discover the module.
I believe it would be good if the documentation had an example that just works locally on the SQL server. To not have to setup WinRM, Remoting etc. In the PowerShell integrated docs it seems quiet easy...
get-help New-DcnImage -examples
NAME
New-DcnImage
SYNOPSIS
New-DcnImage creates a new image
-------------------------- EXAMPLE 1 --------------------------
PS C:\>New-DcnImage -SourceSqlInstance SQLDB1 -DestinationSqlInstance SQLDB2 -ImageLocalPath C:\Temp\images\ -Database DB1 -CreateFullBackup
Create an image for databas DB1 from SQL Server SQLDB1. The temporary destination will be SQLDB2.
The image will be saved in C:\Temp\images.
-------------------------- EXAMPLE 2 --------------------------
PS C:\>New-DcnImage -SourceSqlInstance SQLDB1 -DestinationSqlInstance SQLDB2 -ImageLocalPath C:\Temp\images\ -Database DB1 -UseLastFullBackup
Create an image from the database DB1 on SQLDB1 using the last full backup and use SQLDB2 as the temporary database server.
The image is written to c:\Temp\images