• Gustavo
    0
    Restore the full backup ok, but when try to restore differencial backups I get the next Error:This differential backup cannot be restored because the database has not been restored to the correct earlier state.
    This is the log

    2021-06-01 10:52:19,226 [SERV] [1] NOTICE - **********************************************************************************************************
    2021-06-01 10:52:19,262 [SERV] [1] NOTICE - CloudBerry Backup for MS SQL Server Engine Started. Version: 7.1.0.206
    2021-06-01 10:52:19,263 [SERV] [1] NOTICE - Plan: Restore plan on 01/06/2021 10:52:13 (aa3bcf14-6eb8-44c2-bb7d-49596e187966). Type: RestoreDatabasePlan. Start mode: Normal
    2021-06-01 10:53:10,722 [SERV] [1] ERROR - Failed to restore database: NovaNet_Tools
    CloudBerryLab.Backup.MSSQL.Exceptions.SqlErrorException
    No se puede restaurar la copia de seguridad diferencial porque la base de datos no se ha restaurado al estado anterior correcto.
    Fin anĂ³malo de RESTORE DATABASE.

    at BAL.b()
    at BAl.A(BAe , SqlConnection , BAL , String , BAd , ICancelable )
    at BAl.A(MSSQLRestoreType , String , String , Boolean , Boolean , Nullable`1 , List`1 , ICancelable )
    at Cf.M()

    2021-06-01 10:53:10,817 [PL] [1] ERROR - Failed to restore database; Code - 2006
    2021-06-01 10:53:10,842 [PL] [1] ERROR - CBL2006: No se puede restaurar la copia de seguridad diferencial porque la base de datos no se ha restaurado al estado anterior correcto.
    Fin anĂ³malo de RESTORE DATABASE.


    2021-06-01 10:53:10,855 [SERV] [1] NOTICE - =
    2021-06-01 10:53:10,856 [SERV] [1] NOTICE - Starting (Running) / 00:00:50 /
    2021-06-01 10:53:10,857 [SERV] [1] NOTICE - Total: (Total) / 00:00:50 / Downloaded: 139 MB Size on disk: 151 MB
    2021-06-01 10:53:10,858 [SERV] [1] NOTICE - =
    2021-06-01 10:53:10,859 [SERV] [1] NOTICE - Plan status: Fail. Elapsed time: 00:00:50.7587050. Version: 7.1.0.206
    2021-06-01 10:53:10,881 [SERV] [1] NOTICE - Elapsed time: 00:00:51. Max memory usage: 136 MB. Processor time: 00:00:04. DB connection: 16 DB query: 23 Status report: 74
    2021-06-01 10:53:10,883 [SERV] [1] NOTICE - IO stats: read bytes: 127639532, write bytes: 285666640, other bytes: 109537716, reads: 795, writes: 434, other ops: 10085
    2021-06-01 10:53:10,895 [SERV] [1] NOTICE - Scanned: 2(151 MB). Uploaded: 2(151 MB). Failed: 0
    2021-06-01 10:53:12,012 [SERV] [1] NOTICE - Plan finished. CloudBerry Backup for MS SQL Server. Version: 7.1.0.206
  • David Gugick
    118
    The Differential backup you are restoring does not belong with the Full backup you restored - is the most likely reason. Has anyone run any full backups on that database after the full backup, but before the differential backup? If so, that's the reason. You would need to perform a COPY ONLY backup to prevent this issue.

    You can check your msdb database to see what has been run on the database in question. I think you can check the database_backup_lsn column to see what set the backup belongs to. Run a query like this and change the database name as needed.

    -- Last 1000 database backups performed
    SELECT TOP 1000
      db.name "DatabaseName", 
      bs.server_name "ServerName",
      bs.backup_set_id "BackupSetID",
      bs.name "Name",
      CASE bs.type
        WHEN 'D' THEN 'D-Database'
        WHEN 'I' THEN 'I-Differential'
        WHEN 'L' THEN 'L-Log'
        WHEN 'F' THEN 'F-File'
        WHEN 'G' THEN 'G-Differential'
        WHEN 'P' THEN 'P-Partial'
        WHEN 'Q' THEN 'Q-DifferentialPartial'
        ELSE bs.type
      END "Type", 
      bs.backup_start_date "StartDate",
      DATEDIFF(mi, bs.backup_start_date, bs.backup_finish_date) "Duration(Min)",
      CAST(bs.backup_size/1024/1024 AS DECIMAL(11,2)) "Size(MB)",
      bs.user_name "UserName",
      CAST(bs.software_major_version AS VARCHAR(3)) + '.' + CAST(bs.software_minor_version AS VARCHAR(3)) + '.' + CAST(bs.software_build_version AS VARCHAR(5)) "SQLServerVersion"
      -- Uncomment the following line for additional Backup data
      ,bs.*
    FROM
      master.dbo.sysdatabases db 
    INNER JOIN 
      msdb.dbo.backupset bs 
    ON
      bs.database_name = db.name 
    WHERE
      bs.database_name = N'AdventureWorks'
    ORDER BY 
      bs.backup_start_date desc;
    
bold
italic
underline
strike
code
quote
ulist
image
url
mention
reveal
youtube
tweet
Add a Comment