-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
[Bug] Restore-DbaDatabase -RestoreTime date formatting error between fr/US #7377
Comments
does this happen if you pass
? i.e. a full-blown datetime rather than a string |
Yes I get the same behaviour when I pass a datetime to the command. Maybe it's the same issue as #6483 ? |
ToPointInTime of the restore SMO is a string. I think we had issues like that and fixed a lot of them. Try to find the change... |
Line 251 of Invoke-DbaAdvancedRestore: |
ouch. ISOish (minus the localization) should work. yyyy-MM-ddTHH:mm:ss.fff is the "less error prone" of the whole bunch. |
Have a look at #6452 - some Culture settings change ":" to "." so we added this. |
yup, that's surely a bit to add. I was making a point towards making the format string insert the "T" between date and time parts. you posted I posted
What I was trying to say is use
|
And I have totally overlook that. Not sure about the "T" - we have to try. Do you have time to test this? |
T is on #6452 too. SQL handles it fine. |
someone already did extensive tests tl:dr: there's no clear indication on what format is the gold standard, but ISOish with T ends up with success most of the times |
@WidCed Are you able to use this branch and test the change? |
Hi, It works:
Output:
Thank you very much ! |
Report
Host used
Errors Received
Steps to Reproduce
Restore-DbaDatabase -SqlInstance $SqlInstance -Path $BackupPath -DatabaseName $DatabaseName -WithReplace -DestinationDataDirectory $DestDataDir -DestinationLogDirectory $DestLogDir -MaintenanceSolutionBackup -RestoreTime "2021-05-26 14:00"
Expected Behavior
RESTORE DATABASE [redacted] FROM DISK = N'redacted' WITH FILE = 1, MOVE N'redacted' TO N'redacted', MOVE N'redacted' TO N'redacted', NORECOVERY, NOUNLOAD, REPLACE, STATS = 10,
STOPAT = N'26/05/2021 14:00:00'
Actual Behavior
RESTORE DATABASE [redacted] FROM DISK = N'\redacted' WITH FILE = 1, MOVE N'redacted' TO N'redacted', MOVE N'redacted' TO N'redacted', NORECOVERY, NOUNLOAD, REPLACE, STATS = 10,
STOPAT = N'05/26/2021 14:00:00'
Environmental information
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
Please provide the output of the below script
SQL Server:
The text was updated successfully, but these errors were encountered: