How to Rebuild the Roundcube Database

Last modified: April 17, 2024


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.

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:

Name Description Example
/home/username/etc/domain/username.rcube.db.1495814375 A backup file with a Unix timestamp. username.rcube.db.1495814375
/home/username/etc/domain/username.rcube.db.latest A symlink to the latest Roundcube backup. username.rcube.db.latest
/home/username/etc/domain/username.rcube.db.datestamp.sqlite2 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:

1
2
/usr/local/cpanel/bin/update-roundcube-db
/usr/local/cpanel/bin/update-roundcube-sqlite-db

Note:
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

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

1
2
3
4
5
6
7
8
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

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

1
2
3
4
5
6
7
8
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