ERROR MESAGGE:
“The log in this backup set begins at LSN (xxx), which is too recent to apply to the database. An earlier log backup that includes LSN (xxx) can be restored.”
EXPLANATION:
You receive this error when trying to restore a Transaction Log backup.
When you restore database backups, the sorting should be as follows:
– First, Full Backup of the database is restored.
– Then Differential Backup is restored.
– Lastly, Transaction Log Backup backups are restored.
Let’s say you have a full backup of the file name “MyDatabase.BAK”.
After that, you have taken a backup of Transaction Log two times, “TransactionLogBackup1.trn” and “TransactionLogBackup2.trn”
You must first restore the full backup with the WITH NORECOVERY commands.
For Example:
1 | RESTORE DATABASE MyDatabase FROM DISK = N'C:\Backups\MyDatabase.BAK' WITH NORECOVERY; |
Then, respectively, transaction log backups are restored. According to our scenario, the transaction log backup that needs to be restored after the “MyDatabase.BAK” file is “TransactionLogBackup1.trn”.
if you try to restore the file “TransactionLogBackup2.trn” before the “TransactionLogBackup1.trn” file, you will see this error.
SOLUTION:
You must restore Transaction Log Backups in the correct order.