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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Importing db from .bak file

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-08-26 : 08:12:43
John writes "A customer has sent me a copy of two db's in .bak form. I need to import those db's into existing ones for use on their website. I have created 2 db's with the same names as the ones on their old providers SQL server. If I try to Restore the .bak file to one of the newly created db's, it errors out. Am I going about this wrong, or am I just missing something? Any help or pointing in the right direction would really be appreciated. Thanks."

shsmonteiro
Constraint Violating Yak Guru

290 Posts

Posted - 2003-08-26 : 09:00:12
What is your SQL version? And what is the error message?

regards,

Sérgio Monteiro
Trust in no Oracle
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-08-26 : 12:38:36
Here is an example of the RESTORE command to run inside Query Analyzer:

RESTORE DATABASE DBNameGoesHere
FROM DISK = 'F:\MSSQL\Backup\FileName.bak'
WITH REPLACE, STATS, MOVE 'DBNameGoesHere_Data' TO 'E:\MSSQL\Data\DBNameGoesHere_Data.MDF',
MOVE 'DBNameGoesHere_Log' TO 'F:\MSSQL\Data\DBNameGoesHere_Log.LDF'

What is the command that you are running?

Tara
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-08-26 : 13:05:28
Most of the time, the only error I get while restoring a database backup from another machine is regarding invalid file paths caused by the difference in SQL Server installation paths. If you donot change the file path to restore the data and log files to, it'll try to restore to the paths recorded in the backup file, which might be an invalid folder or file name on the current machine.

Owais


Make it idiot proof and someone will make a better idiot
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-08-26 : 13:34:17
The MOVE command in the above example shows how to correct the problem that Owais mentioned.

Tara
Go to Top of Page

shsmonteiro
Constraint Violating Yak Guru

290 Posts

Posted - 2003-08-26 : 22:45:08
Another possible error is to have 2 backups in one physical device and do not specify the FILE paremeter in restore operation, or choose the right backup in EM, qhen you want to restore the second(and son on...) backup.

Not sure if it would return an error or just restore over and over the same backupset.

regards,

Sérgio Monteiro
Trust in no Oracle
Go to Top of Page
   

- Advertisement -