Page 1 of 1

Upgrading Roundcube to 1.3.8 on Ubuntu 16.

Posted: Fri Nov 09, 2018 9:35 am
by plutocrat
OK, I tried this before and got stuck. Just came up with the winning formula, so I thought I'd preserve it here. I wanted to start a new thread for it, because I think this also has relevance to the installation of VestaCP on Ubuntu 18. The version of roundcube on Ubuntu 18 is 1.3.6, which uses a different config file format to the 1.2Beta roundcube on Ubuntu 16, and causes a database error. So ... as root user or sudo ...

Code: Select all

## Backup all roundcube directories. 
mkdir ~/rc-upgrade
cd ~/rc-upgrade
mysqldump roundcube > roundcube-backup.sql
mkdir old-etc
rsync -avz /etc/roundcube/ ./old-etc/
mkdir old-varlib
rsync -avz /var/lib/roundcube/ ./old-varlib/
mkdir old-usrshare
rsync -avz /usr/share/roundcube/ ./old-usershare/
# That's your backup. Restore these 4 if you mess up. 
Now to upgrade. You'll need to create a config dir in /usr/share/roundcube. Without this the install script will fail, and won't complete the upgrade!!

Code: Select all

cd /usr/share/roundcube/ 
ln -s /var/lib/roundcube/config ./
# You alternatively also link to /etc/roundcube/config, which is the same place. 

## Back to your temp install folder. cd ~/rc-upgrade/
tar zxf roundcubemail-1.3.8-complete.tar.gz 
cd roundcubemail-1.3.8/bin
# Run the installer. Point it at /usr/share/roundcube, although this is extensively symlinked from the other two dirs. 
./ /usr/share/roundcube/
At this point, you'll get a nice Database Error when you try to login to roundcube. There is a key change in the config files that needs to be addressed.

Code: Select all

cd /etc/roundcube/
# Find the correct value. 
grep db_dsnw debian-db-roundcube.php
# This will give you something like ---> $rcmail_config['db_dsnw'] = 'mysql://roundcube:aabbccddeeff@localhost/roundcube';
# Now insert into the actual config file. 
nano /etc/roundcube/
# Find the line that says $config['db_dsnw'] = 'mysql://roundcube:@localhost/roundcubemail';
# Change to --> $config['db_dsnw'] = 'mysql://roundcube:aabbccddeeff@localhost/roundcube';
NB. $rcmail_config has now changed to $config.
NB. Database string changes default db from roundcubemail to roundcube, and inserts the password string.

Now you should be able to log into roundcube. You might want to "apt-mark hold roundcube" to stop it upgrading from the Ubuntu repos.

I haven't tested it yet, but I believe these config file changes are responsible for the VestaCP installer not working on Ubuntu 18.