Upgrading Limesurvey with (near) zero downtime
Limesurvey is an online survey tool. It is very powerful and commonly used in academic environments because it is Free Software (GPLv2+), allows for local installations protecting the data of participants and allowing to comply with data protection regulations. This also means there are typically no load-balanced multi-server szenarios with HA databases. But simple VMs where Limesurvey runs and needs upgrading in place.
There's an LTS branch (currently 3.x) and a stable branch (currently 4.x). There's also a 2.06 LTS branch that is restricted to paying customers. The main developers behind Limesurvey offer many services from template design to custom development to support to hosting ("Cloud", "Limesurvey Pro"). Unfortunately they also charge for easy updates called "ComfortUpdate" (currently 39€ for three months) and the manual process is made a bit cumbersome to make the "ComfortUpdate" offer more attractive.
Due to Limesurvey being an old code base and UI elements not being clearly separated, most serious use cases will end up patching files and symlinking logos around template directories. That conflicts a bit with the opaque "ComfortUpdate" process where you push a button and then magic happens. Or you have downtime and a recovery case while surveys are running.
If you do not intend to use the "ComfortUpdate" offering, you can prevent Limesurvey from connecting to
http://comfortupdate.limesurvey.org daily by adding the
updatable stanza as in line 14 to
- return array(
- // Use the following config variable to set modified optional settings copied from config-defaults.php
- // debug: Set this to 1 if you are looking for errors. If you still get no errors after enabling this
- // then please check your error-logs - either in your hosting provider admin panel or in some /logs directory
- // on your webspace.
- // LimeSurvey developers: Set this to 2 to additionally display STRICT PHP error messages and get full access to standard templates
- 'debugsql'=>0, // Set this to 1 to enanble sql logging, only active when debug = 2
- // Mysql database engine (INNODB|MYISAM):
- 'mysqlEngine' => 'MYISAM'
- , // Update default LimeSurvey config here
- 'updatable' => false,
The comma on line 13 is placed like that in the current default limesurvey
config.php, don't let yourself get confused.
Every item in a php array must end with a comma. It can be on the next line.
The basic principle of low risk, near-zero downtime, in-place upgrades is:
- Create a diff between the current release and the target release
- Inspect the diff
- Make backups of the application webroot
- Patch a copy of the application in-place
- (optional) stop the web server
- Make a backup of the production database
- Move the patched application to the production webroot
- (if 5) Start the webserver
- Upgrade the database (if needed)
- Check the application
So, in detail:Continue reading "Upgrading Limesurvey with (near) zero downtime"