Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2003
    Posts
    2

    Unanswered: Restore Database Question

    Hello There,

    I have a question about Restoring a database. How do I restore an existing Backup file of a database to a different database ?

    For example, I have a backup file "a.bak", of the database name "a". This database has original file names as "a_data.mdf" and "a_log.ldf".

    Can I restore this bak up file to a new database, say "b" which would have corresponding original file name as "b_data.mdf" and "b_log.ldf" ?

    Please show me how to do this with window interface, if you can.

    I would appreciate very much.

    -pnn

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    In Enterprise Manager, right-click on Databases and select All Tasks, Restore Database.
    In the Restore as database box, enter a new database name, or the name of the db you want to overwrite.
    Select Restore: From device. Click Select Devices. If there is a device listed, click the Remove button (this doesn' actually affect the device!). Not click the Add button and browse/select the database file you want to restore.
    Back out ot the first dialog, then go to the options tab.
    Your logical file names can remain the same, but your physical file names should already have the name of your new database.
    Make sure the Recover completion state option is set to leave the database operational, and then click OK.

    Let us know if you have any other questions about this. Don't sweat it, because its very routine.

    blindman

  3. #3
    Join Date
    Aug 2003
    Posts
    2

    Talking

    Thank you for your prompt response!

    You are NOT BLIND at all, Blind Man ! You're great !

  4. #4
    Join Date
    Aug 2003
    Posts
    5

    do i need mdf and other files?

    hi!

    our company used to have our web site (and the DB) hosted and managed by our vendor. we are now in the process of migrating it to our in house servers.

    so i need to migrate the DB too (SQL Server). so far i got .bak file. do i need any other files to restore the db (like .mdf, etc)?

    thanks,
    JN.

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    your .BAK file is all you need. But I would consider making backups of your system db's as well, unless you have no DTS packages, scheduled tasks, backup history to care for, and logins.

  6. #6
    Join Date
    Aug 2003
    Posts
    5

    errors

    i'm getting this error (attached).
    Attached Thumbnails Attached Thumbnails db.gif  

  7. #7
    Join Date
    Jun 2003
    Location
    Denver, CO
    Posts
    2
    jnurbek,
    Complete the tasks that blindman posted.

    It is possible that the database is trying to restore to a drive location that is not valid.

    Regards

  8. #8
    Join Date
    Oct 2001
    Location
    Naples, FL
    Posts
    273
    All that error is telling you is that you are trying to restore a database that has a different location for the log and data files than the destination database has. Example: if I had

    db1
    data file - c:\db1.mdf
    log file - c:\db1.ldf

    and tried to restore a database that was

    db2
    data file - d:\db2.mdf
    log file - d:\db2.ldf

    it would give me your error, it tells you what you need to do by saying use the "with move" option.

    For the above example you would write

    RESTORE DATABASE db1
    FROM DISK= 'wherever you have your backupfile.bak'
    WITH RECOVERY,replace,
    MOVE 'db2_data'
    TO 'c:\db1.mdf',
    MOVE db2_log'
    TO 'c:\db1.ldf'

    HTH
    ---------------
    Ray Higdon MCSE, MCDBA, CCNA

  9. #9
    Join Date
    Aug 2003
    Posts
    5
    thanks! i figured it out. i just changed the localtion from d:\ to c:\ and everything worked.
    Attached Thumbnails Attached Thumbnails db.gif  

  10. #10
    Join Date
    Aug 2003
    Posts
    5
    damn it! i could restore the db on my local machine but when i tried on the server i get the following error. any idea? thanks.
    Attached Thumbnails Attached Thumbnails db.gif  

  11. #11
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    What were the options and parameters you were using in your restore?

    Also, consider using the RESTORE DATABASE command through SQL. Not everything has to be done through #*(&$^# wizards!

    blindman

  12. #12
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Sounds like you're running different editions on your PC and the server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •