Fixing a Corrupted RoundCube SQLite Database

Introduction:

Occasionally, users may encounter issues with RoundCube, preventing them from accessing their webmail. This can manifest as failed login attempts or redirection to a login page when accessed through cPanel. This detailed guide provides step-by-step instructions to resolve these problems.

Here is a step-by-step guide on how to Fix a Corrupted RoundCube SQLite Database

  1. Navigating to the Directory:

    a.   Start by locating the directory:

    /home/<cpanel_user>/etc/<domain>/
  2. Restoring from Backups:

    First, we will try to restore the file from cpanel generated backup

    a.To do this Rename or Move the Database File:

    • Rename the below file
      <email_user>.rcube.db

      to

      <email_user>.rcube.db.bak
    • Alternatively, you can move it out of the folder for safekeeping.

    b. Selecting a Backup Version:

    • Identify the most recent backup copy by examining the timestamp on files named
    <email_user>.rcube.db.<number_stamp>
    • Choose the latest one.

    c. Applying the Backup:

    • Rename the chosen backup file to
      <email_user>.rcube.db

    d. Testing:

    • Attempt to access RoundCube again to ensure the issue is resolved.
  3. Starting RoundCube from begining:

    If the issue is not been fixed, alternatively we can start rouncude to start from the begining by following the below steps

    a.To do this Rename or Move the Database File:

    • Rename the below file
      <email_user>.rcube.db

      to

      <email_user>.rcube.db.bak
    • Alternatively, you can move it out of the folder for safekeeping.

    b. Restarting PHP-FPM (For Servers Using cPanel with PHP-FPM):

    • If your server employs PHP-FPM for the cPanel service, execute the following commands to restart it:
      bash
      /scripts/restartsrv_cpanel_php_fpm --stop
      /scripts/restartsrv_cpanel_php_fpm --start
      

    c. Testing:

    • Try accessing RoundCube again to see if the issue has been resolved.
  4. Logging in:
    • Access your account either through cPanel or
      https://www.domain.com:2096

      select RoundCube. Your account should now function properly.

Additional Note:

Copies of your RoundCube database can also be found within any full cpmove backup.

These backups are stored in the following directory:

(cpmove-<user>.tar.gz) homedir/etc/<domain>/<user>rcube.db

That is it how to Fix a Corrupted RoundCube SQLite Database