Upgrading roundcube to 0.9.5 how-to

Discussion in 'Installation/Configuration' started by tfboy, Dec 22, 2013.

  1. tfboy

    tfboy Member

    Hi,
    I'm playing around with upgrading roundcube from the 0.7.x release provided on the ubuntu database with the 0.9.x version from roundcube's website for two reasons, one because it adds support for the plugin manager and I'd like to add further plugins like captch security, and two, it just looks damn sexier :)

    I'm actually a Linux noob so the upgrade wasn't exactly straight forward and I did come into a few issues. This thread initially started out as a "help" one, but as I've managed to get it working, I thought I'd post here in case it helps others.

    First of all, I backed up the /etc/roundcube directory just in case. The bigger issues were actually around the database and I as my sql is rusty, I just did a backup of the filesystem to be able to roll back just in case.

    Once you're satisfied with a backup, download the recent package from roundcube.net's website. I downloaded the complete package for version 0.9.5 in /tmp
    Code:
    cd /tmp
    wget http://sourceforge.net/projects/roundcubemail/files/roundcubemail/0.9.5/roundcubemail-0.9.5.tar.gz/download
    Then rename it with a tar.gz extension and untar it:
    Code:
    mv download roundcubemail-0.9.5.tar.gz
    tar xf roundcubemail-0.9.5.tar.gz
    Then run the update script:
    Code:
    cd roundcubemail-0.9.5/
    bin/installto.sh /var/lib/roundcube
    The big problem I then had was around the database. I think 0.9.5 is a different schema and the update doesn't fully work because the access method is different so the script can't actually connect to the database to update it at all. The end of the output
    Code:
    ...
    larry/includes/links.html
    larry/includes/mailtoolbar.html
    larry/includes/settingstabs.html
    larry/templates/
    larry/templates/about.html
    larry/templates/addressbook.html
    larry/templates/compose.html
    larry/templates/contact.html
    larry/templates/contactedit.html
    larry/templates/contactsearch.html
    larry/templates/error.html
    larry/templates/folderedit.html
    larry/templates/folders.html
    larry/templates/identities.html
    larry/templates/identityedit.html
    larry/templates/importcontacts.html
    larry/templates/login.html
    larry/templates/mail.html
    larry/templates/message.html
    larry/templates/messageerror.html
    larry/templates/messagepart.html
    larry/templates/messagepreview.html
    larry/templates/messageprint.html
    larry/templates/plugin.html
    larry/templates/settings.html
    larry/templates/settingsedit.html
    
    sent 667227 bytes  received 3655 bytes  1341764.00 bytes/sec
    total size is 655013  speedup is 0.98
    sending incremental file list
    index.php
    
    sent 12076 bytes  received 31 bytes  24214.00 bytes/sec
    total size is 11999  speedup is 0.99
    sending incremental file list
    .htaccess
    
    sent 1422 bytes  received 31 bytes  2906.00 bytes/sec
    total size is 1345  speedup is 0.93
    sending incremental file list
    main.inc.php.dist
    
    sent 38868 bytes  received 31 bytes  77798.00 bytes/sec
    total size is 38779  speedup is 1.00
    sending incremental file list
    db.inc.php.dist
    
    sent 2976 bytes  received 31 bytes  6014.00 bytes/sec
    total size is 2893  speedup is 0.96
    sending incremental file list
    CHANGELOG
    
    sent 17045 bytes  received 31 bytes  34152.00 bytes/sec
    total size is 16968  speedup is 0.99
    sending incremental file list
    README.md
    
    sent 3835 bytes  received 31 bytes  7732.00 bytes/sec
    total size is 3758  speedup is 0.97
    sending incremental file list
    UPGRADING
    
    sent 2789 bytes  received 31 bytes  5640.00 bytes/sec
    total size is 2712  speedup is 0.96
    sending incremental file list
    LICENSE
    
    sent 35226 bytes  received 31 bytes  70514.00 bytes/sec
    total size is 35147  speedup is 1.00
    done.
    
    Removing old default skin...done.
    
    Running update script at target...
    WARNING: Replaced config options:
    (These config options have been replaced or renamed)
    - 'default_imap_folders' was replaced by 'default_folders'
    - 'pagesize' was replaced by 'mail_pagesize'
    - 'top_posting' was replaced by 'reply_mode'
    
    NOTICE: Obsolete config options:
    (You still have some obsolete or inexistent properties set. This isn't a problem but should be noticed)
    - 'mime_magic'
    
    Do you want me to fix your local configuration? (y/N)
    y
    . backing up the current config files...
    . writing /var/lib/roundcube/config/main.inc.php...
    . writing /var/lib/roundcube/config/main.db.php...
    Done.
    Your configuration files are now up-to-date!
    Executing database schema update.
    ERROR: Configuration error. Unsupported database driver: All done.
    After some searching on the net, I found that the /etc/roundcube/db.inc.php had completely changed format and it's in here that the database access is configured.
    Round about line 25, you'll have this:
    Code:
    $rcmail_config['db_dsnw'] = '://:@localhost/';
    
    which needs to be updated to reflect your installation. I commented that line out and updated it with the correct information:
    Code:
    $rcmail_config['db_dsnw'] = 'mysql://root:RootSQLPass@localhost/roundcube';
    where RootSQLPass is the password for the root user (assuming you didn't change the user from root to something else in the Perfect Server guide).
    This will allow roundcube to access the database. To fix the schema, I enabled the web configuration to go through it.
    Around line 173 of etc/roundcube/main.inc.php change the value to true:
    Code:
    $rcmail_config['enable_installer'] = true;
    If all is well, you can now launch the web installer by going to your base roundcube url appending /installer on the end; i.e. http://server/roundcube/installer
    When you get to page 3, it will be able to connect but say there's an error in the database and the schema needs updating. Select the version you previously had installed from the drop down menu; I had 0.7.4 and click update. If all goes well, that will be it and the new version will now work.
    Remember to go back in and set the enable_installer line to false. If you don't, roundcube will remind you on the login page :) In fact, the roundcube guide suggests even removing the /installer directory to be extra secure.

    I hope this helps others out. Mods, feel free to amend if bits sound confusing.
     

Share This Page