Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kbmccarthy
Starting Member
6 Posts |
Posted - 2007-10-24 : 18:11:02
|
Hello all,I have a .BAK file that is a full backup of our production database named variable_prod, from server X. I want to restore it onto a different server, server Y, as database variable_test.I've copied the .BAK file onto the D:\ of server Y.When I try to run the following queryRESTORE DATABASE variable_testFROM DISK = 'D:\database backups\variable_prod*******.BAK'WITH REPLACE, MOVE 'variable_test_data' TO'D:\variable_test_data.MDF',MOVE 'variable_test_log' TO 'D:\variable_test_log.LDF'It doesn't work. I then ran RESTORE FILELISTONLYFROM DISK = 'D:\database backups\variable_prod*******.BAK'And the following was returned (it actually uses Adbase which is not the name of the previous or new database):Adbase_data | E:\SQLDATA\variable_prod_data.MDFAdbase_log | F:\SQLLOGS\variable_prod_data.LDFUnfortunately, server X where variable_prod is, has the E: and F: drives where these files are. However, server Y does not have F: and E: setup this way. Eventually I want the .MDF and .LDF files for server Y to be in the following directory D:\SQLDATA and D:\SQLLOGSAny help or insights would be greatly appreciated.ThanksAdbase_log |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-10-24 : 18:15:10
|
MOVE 'Adbase_data' TO 'D:\SQLDATA\Adbase_data.MDF',MOVE 'Adbase_log' TO 'D:\SQLLOGS\Adbase_log.LDF'Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
kbmccarthy
Starting Member
6 Posts |
Posted - 2007-10-24 : 18:29:56
|
Excellent.Thanks, that seems so obvious. One more question, do the adbase_data.mdf and adbase_log.ldf files need to exist before running the query?Thanks again |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-10-24 : 18:36:13
|
No. The restore will create them.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
Kristen
Test
22859 Posts |
|
|
|
|
|
|