problem with restoring database

  • Dear,

    I have backed up my database from server where we have hosted our website.After backing up database. I want to restore that database on my local computer's SQL SERVER.but it gives a msg as given below.

    First it gives "you are attempting to overwrite an existing database.check the force restore over existing database option to overwrite an existing database."

    When i check this option. it gives a msg as below.

    Device Activation Error.The Physical file name

    'D:\home\resadmin\aswaqakhlj\aswaqalkhaleej.com\db\aswaq_data.mdf' may be incorrect.

    File 'aswaq_Data cannot be restored to 'D:\home\resadmin\aswaqakhlj\aswaqalkhaleej.com\db\aswaq_data.mdf'

    Use WITH MOVE to identify a valid location for the file.

    Device Activation Error.The Physical file name

    'D:\home\resadmin\aswaqakhlj\aswaqalkhaleej.com\db\aswaq_log.Ldf' may be incorrect.

    File 'aswaq_log cannot be restored to 'D:\home\resadmin\aswaqakhlj\aswaqalkhaleej.com\db\aswaq_LOG.Ldf'

    Use WITH MOVE to identify a valid location for the file.

    RESTORE DATABASE is terminating abnormally.

    the path('D:\home\resadmin\aswaqakhlj\aswaqalkhaleej.com\db\aswaq_data.mdf') is a server path not my local computer path.

    Please help me out

    Waiting for reply.

    regards,

  • When you restore the database it will try and put the files back into the same location they were in when the database was backed up. What you need to do is redirect them.

    E.G.

    RESTORE DATABASE MyDatabase From Disk = N'C:\backup\mydb.bak' 

    WITH MOVE N'Aswaq_Data' TO N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\aswaq_data.mdf',

    MOVE N'Aswaq_Log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\aswaq_log.ldf',

    REPLACE;

    This script assumes that your logical file names are Aswaq_data and Aswaq_log you may need to change them as your logical file names may be different to find out what they are you can run this.

    RESTORE FILELISTONLY MyDatabase From Disk = N'C:\backup\mydb.bak'

    This will list all the files contained in the backups logical and physical names

    hth

     

    David

     

  • If you are using the wizard to restore the database one thing you need to make sure is changing the name of "Move to physical file name" under the options tab to a valid file name (corect path). SQl Server by default put some path which usually is not valid. (Microsoft may want to fix this, as I see this problem occurring to many people).

  • thanks.....one of those 'duhs' that I hate...........the answer was one tab click away.......

  • Nnada Kumar (6/5/2006)


    If you are using the wizard to restore the database one thing you need to make sure is changing the name of "Move to physical file name" under the options tab to a valid file name (corect path). SQl Server by default put some path which usually is not valid. (Microsoft may want to fix this, as I see this problem occurring to many people).

    Mine is that I've already changed this one, but, still got error with "...MOVE TO....".

    So, I went to ....MOVE TO.... Not sure why wizard doesn't work.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply