UrBackup DB Corruption

If your interface is giving you an error like

This can be solved as follows:

Method 1

UrBackup Server creates nightly backups of its database per default. If the restore procedure fails you can restore those. Restoring your backup database found in the folder 'urbackup' under your back-up directory. Stop the database and rename your old DB backup_server.db in /var/urbackup. copy the backup_server.db of your urbackup folder into the /var/urbackup folder and restart your DB.

Steps:

 service urbackupsrv stop

Create a backup of the damaged database files. Delete all files belonging to the databases:

 backup_server.db, 
 backup_server.db-shm, 
 backup_server.db-wal, 
 backup_server_settings.db, 
 backup_server_settings.db-shm, 
 backup_server_settings.db-wal 
 (rm backup_server*)

Copy the files from the urbackup folder in the storage directory (backup_server.db and backup_server_settings.db) and start UrBackup Server.

Method 2

stop the UrBackup Database with

 service urbackup stop   

Assuming you are using SQLite do the following:

 sqlite3 backup_server.db

Now you can e.g. get a list of existing tables:

 .tables

Make sure, that UrBackup server is not running. The following command enables a more efficient (for single users) journal mode for the database:

 PRAGMA journal_mode=delete;

You could check the integrity of the database with:

 PRAGMA integrity_check;

You can defragment the database (maybe this also fixes integrity issues) with:

 VACUUM;

One way to repair the database is often to export and import the database. That is:

 .output export.sql
 .dump
 .exit

Delete file backup_server.db.

 sqlite3 backup_server.db
 .read export.sql

In most cases that should solve your issue.


Enjoy,

Your ArtIT Team

BACK