{"id":137,"date":"2021-02-24T00:08:13","date_gmt":"2021-02-24T05:08:13","guid":{"rendered":"https:\/\/www.sqlbackupmaster.com\/wordpress\/?p=137"},"modified":"2025-11-11T19:05:11","modified_gmt":"2025-11-12T00:05:11","slug":"sql-server-differential-restore-fails-with-error-this-differential-backup-cannot-be-restored-because-the-database-has-not-been-restored-to-the-correct-earlier-state","status":"publish","type":"post","link":"https:\/\/www.sqlbackupmaster.com\/wordpress\/2021\/02\/24\/sql-server-differential-restore-fails-with-error-this-differential-backup-cannot-be-restored-because-the-database-has-not-been-restored-to-the-correct-earlier-state\/","title":{"rendered":"SQL Server Differential Restore Error: Database Not in Correct Earlier State"},"content":{"rendered":"\n<p>If you encounter the above error while attempting to restore a differential backup, it usually indicates that it&#8217;s being applied to a <strong>full backup<\/strong> that <em>isn&#8217;t the most recent one<\/em>.<\/p>\n\n\n\n<p>The most common cause we&#8217;ve seen is that a third-party program (or a SQL admin) is creating full backups <em>in addition to<\/em> the ones created by SQL Backup Master. And this means a <em>more recent<\/em> full backup likely exists somewhere about which SQL Backup Master has no knowledge.<\/p>\n\n\n\n<p>In other words, a full backup was taken in between the full and differential backups being performed by SQL Backup Master. This results in a broken backup chain.<\/p>\n\n\n\n<p><strong>The very latest full backup must be located and restored prior to any differential what was derived from it. <\/strong>The differential cannot be restored to any prior backup (it must be the latest full backup that was created).<\/p>\n\n\n\n<h3>Diving deeper<\/h3>\n\n\n\n<p>If additional details are required, we recommend querying SQL Server&#8217;s backup set records. Doing so can help you identify where breaks in the backup chain may be occurring. Here&#8217;s a SQL query to get you started &#8211; you may wish to further restrict it by database name, time frame, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT \nmsdb.dbo.backupset.database_name,\nmsdb.dbo.backupset.backup_start_date,\nmsdb.dbo.backupset.backup_finish_date,\nmsdb.dbo.backupset.database_backup_lsn,\nmsdb.dbo.backupset.differential_base_lsn,\nCASE msdb..backupset.type\nWHEN 'D' THEN 'Full'\nWHEN 'L' THEN 'Log'\nWHEN 'I' THEN 'Diff'\nEND AS backup_type,\nmsdb.dbo.backupset.backup_size,\nmsdb.dbo.backupmediafamily.physical_device_name\nFROM msdb.dbo.backupmediafamily\nINNER JOIN msdb.dbo.backupset ON\nmsdb.dbo.backupmediafamily.media_set_id =\nmsdb.dbo.backupset.media_set_id\nORDER BY \nmsdb.dbo.backupset.database_name,\nmsdb.dbo.backupset.backup_finish_date<\/code><\/pre>\n\n\n\n<p><br>Sample query results shown below demonstrate how to correlate a differential backup to a specific full backup. The magnified portion of the screenshot shows a differential backup with a\u00a0<strong>differential_base_lsn<\/strong>\u00a0field correlating to the\u00a0<strong>first_lsn<\/strong>\u00a0field of the full backup that precedes it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"107\" src=\"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-content\/uploads\/2021\/02\/full-diff-correlation3.png\" alt=\"\" class=\"wp-image-154\" srcset=\"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-content\/uploads\/2021\/02\/full-diff-correlation3.png 800w, https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-content\/uploads\/2021\/02\/full-diff-correlation3-300x40.png 300w, https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-content\/uploads\/2021\/02\/full-diff-correlation3-768x103.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>The data provided by this query should help you to locate backup chain breaks. For additional information on querying this information from SQL Server, please see the link below.<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/system-tables\/backupset-transact-sql?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">backupset (Transact-SQL) &#8211; SQL Server | Microsoft Docs<\/a><\/p>\n\n\n\n<h3>Recommendations<\/h3>\n\n\n\n<p>The long-term solution to this problem is to ensure that <em>only <\/em>SQL Backup Master is creating SQL Server backups for your databases. Disable all other automated or scheduled SQL Server backup services for those databases, and use the SQL Backup Master GUI to create manual backups if needed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you encounter the above error while attempting to restore a differential backup, it usually indicates that it&#8217;s being applied to a full backup that isn&#8217;t the most recent one. The most common cause we&#8217;ve seen is that a third-party program (or a SQL admin) is creating full backups in addition to the ones created [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/posts\/137"}],"collection":[{"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":11,"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":589,"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/posts\/137\/revisions\/589"}],"wp:attachment":[{"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlbackupmaster.com\/wordpress\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}