Child pages
  • How to Convert Roundcube to SQLite
Skip to end of metadata
Go to start of metadata


The /usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite script updates the Roundcube configuration to use individual SQLite databases instead of a single MySQL® database. This document explains how to use that script.


If you change Roundcube's database engine to SQLite, you cannot revert the engine to MySQL.

Benefits of Roundcube with SQLite databases

The SQLite database provides the following benefits over MySQL:

  • You can restore Roundcube data more easily. The system stores each email user's Roundcube data in a separate SQLite database file. This behavior allows you to restore data for a single user and not the entire system.
  • You can track disk usage properly because the system stores the Roundcube data within a cPanel user's /home directory. 
  • You can locate problematic accounts more easily because the Roundcube PHP processes run as the cPanel user.
  • A single point of failure does not exist. Because each user's SQLite database remains separate, database corruptions only impact a single user and not the entire system.

Convert Roundcube to SQLite

To convert the Roundcube database in cPanel & WHM from MySQL to SQLite, run the following command:


After you convert the system to SQLite, you can use this script to troubleshoot issues with specific users.

To convert the Roundcube data for a single cPanel user from MySQL to SQLite, run the same command with the user parameter:


In this command, user represents the database user.

/usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite user

Migrate Roundcube MySQL database to SQLite database

To migrate a Roundcube database from one cPanel & WHM server to another and convert the data from MySQL to SQLite, perform the following steps:


This action overwrites all users' data.

  1. On the source cPanel & WHM server, create a backup of the Roundcube database. To do this, run the following command:

    mysqldump roundcube > roundcube.dump


    In this example, roundcube represents the Roundcube database.

  2. On the destination cPanel & WHM server, create a temporary MySQL database. To do this, follow the directions in our MySQL Databases documentation.

  3. On the destination cPanel & WHM server, open the /usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite script and comment out the following lines:

                    unless ( defined $opt_dbname ) {
                        Cpanel::Email::RoundCube::archive_and_drop_mysql_roundcube( $has_db, $logger );
  4. On the destination cPanel & WHM server, import the Roundcube data to the database and convert the data to SQLite. To do this, run the following command on the destination cPanel & WHM server:

    /usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite user litedbfromsql


    The above command contains the following example arguments:

    • user represents the database user.
    • litedbfromsql represents the database to which to import the Roundcube data.

Additional documentation