Link to home
Create AccountLog in
Avatar of Vargk
Vargk

asked on

Restore Sql 2003 from one database backup to a new database

I have got a Sql2005 backup, backupfile.bak from a database that I do not have access to. I have just got the file. I want to use this backup-file to do a restore on my Sql2005 database. Is it possible to do a restore from this backup to a new database ?
Avatar of chapmandew
chapmandew
Flag of United States of America image

restore database newdbname
from disk = 'path to backup file'
with move 'logical data file name' to 'path to data file',
move 'logical log file name' to 'path to new log file'
Avatar of Vargk
Vargk

ASKER

Sorry ! I'm quite new in this things. I think you understand right, but Can you please be very concrete and precise
Can I do this in SQL Server Management Studio or do you mean that I have to make a script ?
Thank you
Avatar of Vargk

ASKER

I have to add that I just have got a backup file (File.bak). I do not have a log file. Should I asked for log file too ?
The log file is contained in the .bak file.

You will want to execute the Script in management studio....make a new query.

You will likely first need to see what files are in your backup file to feed them to your restore db command.  To do this....

restore filelistonly from disk = 'path to backup file'

We'll get you through this...one step at a time.

HTH,
Tim
Avatar of Vargk

ASKER

I do not understand what you trying to tell me. Let me repeat what I am trying to do. I create a new database sql2005, only the name of the database, then I try to restore  a backupfile  : C:\Auto.bak whitch is a backupfile from another database and I get this message:

"The backup set holds a backup of a database other than the existing database"

Is it not possible to use a backup file.bak as a restore to another database. Does it has to be the same database
I do not control the backup process that making the file: Auto.bak, but I have access to the file as a file on my computer.
Thank you  
Yes, but you do not need to create the database first.  All you need to do is restore the database...that process will create the database.
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Vargk

ASKER

Life is good, Thank you very much !