BACKUP LOG cannot be performed because there is no current database backup

前端 未结 14 590
[愿得一人]
[愿得一人] 2021-01-30 09:59

I tried to restore a database but this message showed. How do I restore this database?

Restore of database \'farhangi_db\' failed.
(Microsoft.SqlSer

相关标签:
14条回答
  • 2021-01-30 10:18

    Another cause for this is if you have the same database restored under a different name. Delete the existing one and then restoring solved it for me.

    0 讨论(0)
  • 2021-01-30 10:21

    In case the problem still exists go to Restoration Database page and Check "Restore all files to folder" in "Files" tab This might help

    0 讨论(0)
  • 2021-01-30 10:22

    Originally, I created a database and then restored the backup file to my new empty database:

    Right click on Databases > Restore Database > General : Device: [the path of back up file] → OK

    This was wrong. I shouldn't have first created the database.

    Now, instead, I do this:

    Right click on Databases > Restore Database > General : Device: [the path of back up file] → OK

    0 讨论(0)
  • 2021-01-30 10:26

    You can use following SQL to restore if you've already created database

    RESTORE DATABASE [YourDB]
    FROM DISK = 'C:\YourDB.bak'
    WITH MOVE 'YourDB' TO 'C:\YourDB.mdf',
    MOVE 'YourDB_Log' TO 'C:\YourDB.ldf', REPLACE
    
    0 讨论(0)
  • 2021-01-30 10:27

    I am not sure whether the database backup file, you trying to restore, is coming from the same environment as you trying to restore it onto.

    Remember that destination path of .mdf and .ldf files lives with the backup file itself.

    If this is not a case, that means the backup file is coming from a different environment from your current hosting one, make sure that .mdf and .ldf file path is the same (exists) as on your machine, relocate these otherwise. (Mostly a case of restoring db in Docker image)

    The way how to do it: In Databases -> Restore database -> [Files] option -> (Check "Relocate all files to folder" - mostly default path is populated on your hosting environment already)

    0 讨论(0)
  • 2021-01-30 10:31

    In my case I am restoring a SQL Server 2008 R2 Database to SQL Server 2016 After selecting the file in the General tab, you should go to the Options tab and do 2 things:

    1. You must activate Overwrite existing database
    2. You must deactivate end of record copy
    0 讨论(0)
提交回复
热议问题