dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Copy-Dbadatabase -BackupRestore -SharedPath using other path at restore

Open AGregersen opened this issue 7 years ago • 8 comments

Before submitting a bug report:

  • [x] Ensure you are able to reproduce it on the latest released version (we release often)
  • [x] Verified this bug is not already reported in an issue
  • [x] Verified errors are not related to permissions
  • [ ] Can reproduce in a clean PowerShell session (clean = powershell -NoProfile)

Steps to Reproduce

Copy-DbaDatabase -Source mysourcesql -Destination mydestinationsql -Database mydatabase  -BackupRestore -SharedPath \\myserver\mybackupshare

Expected Behavior

No errors

Actual Behavior

WARNING: [08:55:54][New-DbaDirectory] Failure | xp_create_subdir() returned error 3, 'The system cannot find the path specified.' WARNING: [08:55:54][Copy-DbaDatabase] Failure attempting to restore mydatabase to mydestinationsql | System.Data.SqlClient.SqlError: Cannot open backup device '\myserver\Backup\my_deploy\mydatabase.bak'. Operating system error 2(The system cannot find the file specified.).

To clarify it have worked with other databases, just not this one. It seems like it's getting a path from where the destination usually backup to.

Environmental data

  • PowerShell: PSVersion 5.1.14393.2608 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14393.2608 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
  • SQL Server: Microsoft SQL Server 2012 (SP3-CU10-GDR) (KB4057121) - 11.0.6615.2 (X64) Jan 9 2018 21:26:48 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)

AGregersen avatar Dec 03 '18 09:12 AGregersen

@AGregersen - thank you for the report, what version of dbatools are you currently using?

potatoqualitee avatar Dec 03 '18 09:12 potatoqualitee

Hi Chrissy

Should be the latest – I updated before trying the last time, but both 0.9.704 and 0.9.519 are listed when I do the get-module dbatools -Listavailable

So it might not have been using the latest version – since I didn’t remove the older version and didn’t close the active powershell session.

And it’s amazing work you and the others are doing on this – didn’t know about it before the powershell conference earlier this year.

Cheers, Anders

Fra: Chrissy LeMaire [email protected] Sendt: 3. december 2018 10:57 Til: sqlcollaborative/dbatools [email protected] Cc: Anders Gregersen [email protected]; Mention [email protected] Emne: Re: [sqlcollaborative/dbatools] Copy-Dbadatabase -BackupRestore -SharedPath using other path at restore (#4744)

@AGregersenhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAGregersen&data=02%7C01%7C%7Cf40b82cffe1b48a16f3e08d65905b21f%7C140275f52c6b45899efcebd77efa60aa%7C0%7C0%7C636794278328531824&sdata=jgX5Fit%2FHjZrESxmZ41KH0aVxdeNHGYjXKvEVTgAZo8%3D&reserved=0 - thank you for the report, what version of dbatools are you currently using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsqlcollaborative%2Fdbatools%2Fissues%2F4744%23issuecomment-443652147&data=02%7C01%7C%7Cf40b82cffe1b48a16f3e08d65905b21f%7C140275f52c6b45899efcebd77efa60aa%7C0%7C0%7C636794278328531824&sdata=dy%2B9jUcSNkh0HyGRT9sAyCVt0jNKbSRKfEie514YC8o%3D&reserved=0, or mute the threadhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAny_0MC_5szWambXCuCXfXqkeImgjGXbks5u1PVwgaJpZM4Y-JFL&data=02%7C01%7C%7Cf40b82cffe1b48a16f3e08d65905b21f%7C140275f52c6b45899efcebd77efa60aa%7C0%7C0%7C636794278328531824&sdata=be2GEzUUWKQVwaNQ7BWHsrFwI0JjOCOibTMdrd%2BqeEc%3D&reserved=0.

AGregersen avatar Dec 03 '18 10:12 AGregersen

K, that works thank you. Is it possible to run the migration again with -Verbose and pasting the sanitized output here? Is it repeatable every time? I've seen this issue in the past but thought we addressed it in the backup history.

potatoqualitee avatar Dec 03 '18 10:12 potatoqualitee

and happy you found the tools! psconf.eu is the best 💃 we'll be there again next year

potatoqualitee avatar Dec 03 '18 10:12 potatoqualitee

Hi Chrissy

I’m unable to run it again – the target database is in use and may not be overwritten (again).

It was repeatable every time (ignored Einstein and tried it 3 times) with the same error every time. It’s much like when you have added a backup device on a db and want to backup to a different location using SQL Management Studio.

I’m going to do it again the 16th on our primary servers and I’ll use the -verbose just in case

Fra: Chrissy LeMaire [email protected] Sendt: 3. december 2018 11:06 Til: sqlcollaborative/dbatools [email protected] Cc: Anders Gregersen [email protected]; Mention [email protected] Emne: Re: [sqlcollaborative/dbatools] Copy-Dbadatabase -BackupRestore -SharedPath using other path at restore (#4744)

K, that works thank you. Is it possible to run the migration again with -Verbose and pasting the sanitized output here? Is it repeatable every time? I've seen this issue in the past but thought we addressed it in the backup history.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsqlcollaborative%2Fdbatools%2Fissues%2F4744%23issuecomment-443654910&data=02%7C01%7C%7C993ac5fe658341207cf208d65906f824%7C140275f52c6b45899efcebd77efa60aa%7C0%7C0%7C636794283803928798&sdata=II%2F0PVPZHDRcGPKRXT78tDa7MG53gIZ7EVNT3lPpLWM%3D&reserved=0, or mute the threadhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAny_0OZnmHar4wTgardqoo_juF6Bn6pcks5u1PeTgaJpZM4Y-JFL&data=02%7C01%7C%7C993ac5fe658341207cf208d65906f824%7C140275f52c6b45899efcebd77efa60aa%7C0%7C0%7C636794283803938802&sdata=oTvn%2F1tw4j6Ei2YyIaP2I23Pa9dONhmbfQnDfKrJx%2Bk%3D&reserved=0.

AGregersen avatar Dec 03 '18 11:12 AGregersen

thank you, i look forward to the verbose output 👍

potatoqualitee avatar Dec 08 '18 15:12 potatoqualitee

This issue has been automatically marked as stale because it has not had recent activity. If you would like this issue to remain open:

  • Verify that you can still reproduce the issue in the latest version of dbatools
  • Comment that the issue is still reproducible and include:
    • What version of dbatools you reproduced the issue on
    • What OS and version you reproduced the issue on
    • What steps you followed to reproduce the issue

stale[bot] avatar Feb 06 '19 17:02 stale[bot]

This issue has been automatically closed because it has not had activity in the last three months. If this issue is still valid, please add a comment

stale[bot] avatar Mar 08 '19 18:03 stale[bot]