question

jjockel avatar image
jjockel asked

Copy a Database to a different instance, but keep source operational

I cant use copy DB Wizard. The RESTORE command includes the MOVE command, doesn't this MOVE command move my ldf and mdf to the new DB file location?? If the MOVE command moves my ldf and mdf, doesn't it remove functionality from my source DB. I need to copy my DB to an new instance, but i need to keep my source DB fully operational. Its the MOVE command i am worried about. thank you for your assistance.
restoremovecopy
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Tim avatar image
Tim answered
No, your understanding of WITH MOVE is a bit to literal. If you are restoring the database to a new name or new server and specify WITH MOVE you are specifying where to place the file(s) other than the original path. For instance, if you have your data file on G:\sqldata\dbname.mdf and log on H:\sqllog\dbname.ldf and on the new server you do not have an G: and H: and want to restore the files to drive M:, you could specify WITH MOVE and specify the new path and new names. DB Wizard isn't the option you need if a simple backup/restore would work. The only time a restore would disrupt production is if you are restoring over a production database using WITH REPLACE. Does this help and make sense?
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjockel avatar image jjockel commented ·
Tim, that is great! I really thought that was the case, but i was thrown off by the severity of the command. Thanks for being out there! Jeff
0 Likes 0 ·
Tim avatar image Tim commented ·
No problem Jeff, glad to be able to help.
0 Likes 0 ·
KenJ avatar image KenJ commented ·
Jeff, don't forget to vote for and/or accept Tim's answer. Visitors from the future can use that to determine how helpful the answers on this site are.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.