Malformed Database (code 1046)
The backup plan finishes with the following error: Malformed database. Cannot read data from the database. The disk where the database is located may be damaged or database files are corrupted.
This error appears to be among the most common errors.
The error occurrence means that the repository database cannot be read and the cause is not obvious. It may happen due to several reasons:
- Increased use of SQLite database that results in the significant growth of data
- Hardware failure or flash memory failure
- Other issues
The repository is an internal database in Backup for Windows (or Backup Agent for Windows) designed to optimize the number of requests to cloud storage and some other purposes
To learn more about the repository, refer to the Repository Explained article. The repository is built on SQLite technology
This issue can be resolved by creating a new repository database.
To create a new repository, proceed as follows:
- Run Backup for Windows (Backup Agent for Windows).
- Make sure no backup or restore plans are currently running.
- In the left bottom corner, right-click Backup Service, then select Stop Service.
If you have sufficient privileges, stop the RM Service
- Exit Backup for Windows (Backup Agent for Windows).
- Navigate to the database location. The default location is:
- In Backup for Windows: C:\ProgramData\CloudBerryLab\CloudBerry Backup\Data
- In Backup Agent for Windows: C:\ProgramData\Online Backup\data
In case the repository location is a custom one, in the Tools menu, click Diagnostic, then in the Diagnostic property box, click Open in Folder. The folder with logs is opened. Navigate one level upper and find the data folder. It must contain the cbbackup.db file
- Right-click the cbbackup.db file, then select Rename.
- Rename the repository file to any name different from the original name.
- Run Backup for Windows (Backup Agent for Windows) again. The repository synchronization will start automatically.
In case you have some data in long-term storage, the repository synchronization must be run manually
To do this, in the Tools menu, select Options, switch to the Repository tab, then click Synchronize Repository. Be aware that synchronization may take several hours
You can view the synchronization progress on the 'Welcome' tab under the Storage Accounts section.
Once synchronization is complete, you can see backed up data on the Backup Storage tab and continue working with the backup plans
- Once the repository synchronization is finished, start the Backup Service back manually: in the left bottom corner, right-click Backup Service, then select Start Service.