{"id":685,"date":"2021-07-23T12:35:37","date_gmt":"2021-07-23T12:35:37","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/how-to-convert-roundcube-to-sqlite\/"},"modified":"2021-07-23T12:35:37","modified_gmt":"2021-07-23T12:35:37","slug":"how-to-convert-roundcube-to-sqlite","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/how-to-convert-roundcube-to-sqlite\/","title":{"rendered":"How to Convert Roundcube to SQLite"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>The <code>\/usr\/local\/cpanel\/scripts\/convert_roundcube_mysql2sqlite<\/code> script updates the Roundcube configuration to use individual SQLite databases instead of a single MySQL\u00ae database. This document explains how to use that script.<\/p>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n        If you change Roundcube\u2019s database to a SQLite database, you <strong>cannot<\/strong> revert back to a MySQL database.\n    <\/div>\n<\/div>\n<p>The SQLite database provides the following benefits over a MySQL database:<\/p>\n<ul>\n<li>You can restore Roundcube data more easily. The system stores each email user\u2019s Roundcube data in a separate SQLite database. This behavior allows you to restore data for a single user and not the entire system.<\/li>\n<li>You can track disk usage properly because the system stores the Roundcube data within a cPanel user\u2019s <code>\/home<\/code> directory.<\/li>\n<li>You can locate problematic accounts more easily because the Roundcube PHP processes run as the cPanel user.<\/li>\n<li>A single point of failure does not exist, and database corruptions only impact a single user, not the entire system.<\/li>\n<\/ul>\n<h2 id=\"path-and-filename-for-the-sqlite-database\">Path and filename for the SQLite database<\/h2>\n<p>The SQLite database uses the following path and filename, where <code>username<\/code> represents your cPanel account username and <code>domain<\/code> represents your domain name:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\"><span style=\"color:#e6db74\">\/home\/<\/span>username<span style=\"color:#e6db74\">\/etc\/<\/span>domain<span style=\"color:#f92672\">\/<\/span>username<span style=\"color:#f92672\">.<\/span>rcube<span style=\"color:#f92672\">.<\/span>db<\/code><\/pre>\n<\/div>\n<h2 id=\"convert-roundcube-to-sqlite-database\">Convert Roundcube to SQLite database<\/h2>\n<p>To convert the Roundcube database in cPanel &#038; WHM from MySQL to SQLite, run the following command: <\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\"><span style=\"color:#e6db74\">\/usr\/<\/span>local<span style=\"color:#e6db74\">\/cpanel\/sc<\/span>ripts<span style=\"color:#f92672\">\/<\/span>convert_roundcube_mysql2sqlite<\/code><\/pre>\n<\/div>\n<p>After you convert the system to a SQLite database, you can use this script to troubleshoot issues with specific users.<\/p>\n<p>To convert the Roundcube data for a single cPanel user from MySQL to SQLite, run the same command with the <code>user<\/code> parameter, where <code>user<\/code> represents the database user: <\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\"><span style=\"color:#e6db74\">\/usr\/<\/span>local<span style=\"color:#e6db74\">\/cpanel\/sc<\/span>ripts<span style=\"color:#f92672\">\/<\/span>convert_roundcube_mysql2sqlite user<\/code><\/pre>\n<\/div>\n<h2 id=\"migrate-a-roundcube-mysql-database-to-a-sqlite-database\">Migrate a Roundcube MySQL database to a SQLite database<\/h2>\n<p>To migrate a Roundcube database from one cPanel &#038; WHM server to another and convert the data from a MySQL database to a SQLite database, perform the following steps:<\/p>\n<ol>\n<li>\n<p>On the source cPanel &#038; WHM server, create a backup of the Roundcube database. To do this, run the following command, where <code>roundcube<\/code> represents the Roundcube database: <\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\">mysqldump roundcube <span style=\"color:#f92672\">&gt;<\/span> roundcube<span style=\"color:#f92672\">.<\/span>dump<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\n<p>On the destination cPanel &#038; WHM server, create a temporary MySQL database. To do this, follow the directions in our <em>MySQL Databases<\/em> documentation.<\/p>\n<\/li>\n<li>\n<p>On the destination cPanel &#038; WHM server, open the <code>\/usr\/local\/cpanel\/scripts\/convert_roundcube_mysql2sqlite<\/code> script and convert the following code snippet to a comment:<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">5\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"color:#f92672\">--<\/span>&gt;\n                <span style=\"color:#a6e22e\">unless<\/span> ( <span style=\"color:#a6e22e\">defined<\/span> <span style=\"color:#960050;background-color:#1e0010\">$<\/span><span style=\"color:#a6e22e\">opt_dbname<\/span> ) {\n                    <span style=\"color:#a6e22e\">Cpanel<\/span>::<span style=\"color:#a6e22e\">Email<\/span>::<span style=\"color:#a6e22e\">RoundCube<\/span>::<span style=\"color:#a6e22e\">archive_and_drop_mysql_roundcube<\/span>( <span style=\"color:#960050;background-color:#1e0010\">$<\/span><span style=\"color:#a6e22e\">has_db<\/span>, <span style=\"color:#960050;background-color:#1e0010\">$<\/span><span style=\"color:#a6e22e\">logger<\/span> );\n                }\n<span style=\"color:#f92672\">&lt;--<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p>On the destination cPanel &#038; WHM server, import the Roundcube data to the database and convert the data to SQLite. Run the following command on the destination cPanel &#038; WHM server, where <code>user<\/code> represents the database user and <code>exampledatabase<\/code> represents the database for which to import the Roundcube data:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\"><span style=\"color:#e6db74\">\/usr\/<\/span>local<span style=\"color:#e6db74\">\/cpanel\/sc<\/span>ripts<span style=\"color:#f92672\">\/<\/span>convert_roundcube_mysql2sqlite user exampledatabase<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\n<p>The server will attempt to convert the Roundcube mailbox. If it encounters any errors, it will repeat the process until the conversion is successful.<\/p>\n<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview The \/usr\/local\/cpanel\/scripts\/convert_roundcube_mysql2sqlite script updates the Roundcube configuration to use individual SQLite databases instead of a single MySQL\u00ae database. This document explains how to use that script. Warning: If you change Roundcube\u2019s database to a SQLite database, you cannot revert back to a MySQL database. The SQLite database provides the following benefits over a MySQL &hellip;<\/p>\n","protected":false},"author":1,"featured_media":686,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/685"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=685"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/685\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/686"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}