Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sql-server

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


Another cause of this issue is when the Take tail-log backup before restore "Options" setting is enabled.

On the "Options" tab, Disable/uncheck Take tail-log backup before restore before restoring to a database that doesn't yet exist.


Please see below image and apply changes in SqlServer :

first right click on Database --> Task --> Restore --> Select Backup File --> Finally Apply Change in Options Tab.

please apply changes in SqlServer


  1. Make sure there is a new database.
  2. Make sure you have access to your database (user, password etc).
  3. Make sure there is a backup file with no error in it.

Hope this can help you.


In our case it was due to the Recovery Model on the primary database having been changed after we did the backup in preparation for setting up log shipping.

Ensuring the Recovery Model was set to Full Recovery before doing the backup and setting up log shipping resolved it for us.


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