Overview

If your Roundcube database fails to restart or becomes corrupt, you can rebuild the Roundcube database to repair it. This document explains how to rebuild a Roundcube database in cPanel & WHM version 60 and earlier.

cPanel, Inc. deprecated the update-roundcube and update-roundcube-sqlite scripts in cPanel & WHM version 62.

Path and filename for the database

The SQLite database uses the following path and filename, where username represents a cPanel account username and domain represents a domain name:

/home/username/etc/domain/username.rcube.db

Additionally, the database applies the following naming conventions, where username represents a cPanel account username:

FilenameDescriptionExample
/home/username/etc/domain/username.rcube.db
A backup file with a Unix timestamp.username.rcube.db.1495814375
/home/username/etc/domain/username.rcube.db
A symlink to the latest Roundcube backup.username.rcube.db.latest
/home/username/etc/domain/username.rcube.db
An SQLite v2 backup file.username.rcube.db.20170523105040.sqlite2

Rebuild a Roundcube database

To update a Roundcube database, run one of the following commands:

/usr/local/cpanel/bin/update-roundcube-db --force
/usr/local/cpanel/bin/update-roundcube-sqlite-db --force


The /usr/local/cpanel/bin/update-roundcube-db script will update your database whether you use MySQL® or SQLite. The script recognizes whether you use SQLite and automatically runs the /usr/local/cpanel/bin/update-roundcube-sqlite-db script.

MySQL database

Use the /usr/local/cpanel/bin/update-roundcube-db script to rebuild a Roundcube MySQL database.

To rebuild a Roundcube database, run the following command:

/usr/local/cpanel/bin/update-roundcube-db --force


If the script succeeds, you will receive a message that resembles the following example:

info [update-roundcube-db] Roundcube update from 1.1.4-7.cp1162 to 1.1.4-7.cp1162 in progress.
info [update-roundcube-db] Roundcube will be locked out during this process.
info [update-roundcube-db] Archiving current Roundcube data to /var/cpanel/roundcube/roundcube.backup.sql.1479139688
info [update-roundcube-db] Roundcube DB successfully archived
info [update-roundcube-db] Cleaning old Roundcube data archives
info [update-roundcube-db] Removing old backup: roundcube.backup.sql.1467293128
info [update-roundcube-db] Schema update to 1.1.4-7.cp1162 was successful
info [update-roundcube-db] Roundcube updated to 1.1.4-7.cp1162

SQLite database

Use the /usr/local/cpanel/bin/update-roundcube-sqlite-db script to rebuild a Roundcube SQLite database.

To rebuild a Roundcube database, run the following command:

/usr/local/cpanel/bin/update-roundcube-sqlite-db --force


If the script succeeds, you will receive a message that resembles following example:

info [update-roundcube-db] Roundcube update from 1.1.4-7.cp1162 to 1.1.4-7.cp1162 in progress.
info [update-roundcube-db] Roundcube will be locked out during this process.
info [update-roundcube-db] Archiving current Roundcube data to /var/cpanel/roundcube/roundcube.backup.sql.1479139822
info [update-roundcube-db] Roundcube DB successfully archived
info [update-roundcube-db] Cleaning old Roundcube data archives
info [update-roundcube-db] Removing old backup: roundcube.backup.sql.1469194482
info [update-roundcube-db] Schema update to 1.1.4-7.cp1162 was successful
info [update-roundcube-db] Roundcube updated to 1.1.4-7.cp1162

 

Additional documentation