Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup to different server

Status
Not open for further replies.

andyoye

IS-IT--Management
Mar 23, 2004
56
US
I have a datafile backup "mydb.bak" from SERVER1(source) and I copied to SERVER2(destination) "c:\backup" folder

Now, If I run "RESTORE FILELISTONLY from C:\backup\mydb.bak"
on Server2

Result is:

logic name Physical Loc
mydata E:\xxx\xx\mydata.mdf
mylog C:\xxx\xx\mylog.ldf

Question is.. On my Destination server ( SERVER2), I dont have E:\

How can I copy the backup from Server1 to Server2 so that I can have "mydb" database running on SERVER2?

Do I have to create "mydb" database first on server2 and then use restore command?


 
One more thg:

What is my database name has space i.e

my db

So would this query work?

Restore my db
from Disk xxxxxxx

As I am getting error

Incorrect syntax near the keyword 'from'.

If I use another database that doesnt has space, it works fine.


 
RESTORE DATABASE MyDb
FROM Disk = '\\serverA\Mssql\Backup\Mydb.bak'
WITH STANDBY = 'C:\MSSQL\Log\undoMyDb.ldf'
, MOVE 'MyDb_Data' TO 'C:\MSSQL\Data\MyDb_data.mdf',
MOVE 'MyDb_log' TO 'C:\MSSQL\Log\MyDb_log.ldf'
GO
Try this
Good Luck

Dr.Sql
Good Luck.
 
I believe that when the database has a space in it, you need to use the square brackets around it: [My Db]. Or single quotes around it: 'My Db'.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top