Convert Roundcube to Use SQLite in cPanel

The following are the benefits of running Roundcube over SQLite (on a cPanel based server):

  • SQLite is generally faster than MySQL / MariaDB.
  • Since the SQLite databases are stored in user accounts, it’s accounted for in the user’s disk space usage.
  • Roundcube PHP processes run as the user instead of cpanelroundcube, so it’s easier to identify problematic webmail users.
  • It’s easier to restore Roundcube data from backups on a per-user basis.
  • The numerous failures of InnoDB no longer “break” or affect the former single Roundcube database.

The conversion is a one-way process, against the entire server.

Note: you cannot convert back to MariaDB / MySQL from SQLite data, but you can “roll” back to the previous setup by restoring the Roundcube database and running: /usr/local/cpanel/bin/update-roundcube –force.

SSH into server and create a backup of the existing database:

mysqldump –add-drop-table roundcube > /root/roundcube.sql

Note: To restore the backed up database, the command would be: mysql roundcube < /root/roundcube.sql

Now that we have a backup of the database stored in the /root directory. We can begin the conversion:

/usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite

The above command will create an individual (Roundcube) SQLite database stored for each email account, and will delete the MariaDB / MySQL database.

The location of the data will now be:

Individual SQLite database for each email account – /home/<user>/etc/<domain.com>/<user>.rcube.db

Leave a comment

BlogLogistics