- contribute
- how
- user experience
- Survey platform
We have an installation of LimeSurvey to create surveys:
https://survey.tails.boum.org/
Infrastructure
Puppet configuration files:
Git repositories:
Upstream repo in https://github.com/LimeSurvey/LimeSurvey.git.
Updates repo in /var/lib/limesurvey/ which is synced automatically to the upstream repo.
Production repo in /var/www/limesurvey which has the update repo as origin.
Updating LimeSurvey
Log in to the administration interface to identify which version is currently installed:
Read the release notes:
https://github.com/LimeSurvey/LimeSurvey/blob/master/docs/release_notes.txt.
Connect to the platform:
ssh unlehxtgqn5xg6ccxwnm5w3ddcrll5ctlavo7srjvkkpay67dv3sdzyd.onion
Update the backup of the database:
sudo /usr/sbin/backupninja --now --debug --run /etc/backup.d/10.mysql
Login as
www-data
:sudo -u www-data bash cd ~/limesurvey/
Save a backup of the custom files in the working directory:
tar zcvf /tmp/limesurvey-$(date +%Y-%m-%d-%H:%M).tgz application/config/config.php upload
Fetch the changes from the updates repo:
git fetch origin
Check the version number in the production repo and the updates repo:
git log master git log origin/master
Identity the tag to which to update:
git tag
Merge the updates repo (or the upstream repo) into the production repo:
git merge $TAG
Remove all untracked files:
git clean -df
Restore the custom files:
tar zxvf /tmp/limesurvey-$(date +%Y-%m-%d)-*.tgz
Make sure that our local changes are still here:
git log --no-merges $TAG..
Should return:
commit 38a457d28c4a0598e17692d8c99dd8f6ccdc0200 (HEAD) Author: www-data <www-data@survey.lizard> Date: Thu Aug 3 18:53:17 2023 +0000 Use a more generic message (fundraising#17704) We're now using LimeSurvey to send emails to donors.
Update the database from either:
The command line:
php application/commands/console.php updatedb
The web interface:
One might work but not the other.
Check the version in the footer of:
Remove the backup of the custom files:
rm /tmp/limesurvey-*.tgz
Deleting old tables
When a survey is deactivated in LimeSurvey, the data of the survey (responses
and list of participants) is moved to MySQL tables with the prefix old_
.
To delete all these tables at once:
Connect to the platform:
ssh unlehxtgqn5xg6ccxwnm5w3ddcrll5ctlavo7srjvkkpay67dv3sdzyd.onion
Update the backup of the database:
sudo /usr/sbin/backupninja --now --debug --run /etc/backup.d/10.mysql
Login as
www-data
:sudo -u www-data bash
Store the MySQL password in a shell variable:
grep "'password' =>" /var/www/limesurvey/application/config/config.php | sed -r "s/^\s+'password' => '(\w+)',$/\1/" export PASSWORD=
Delete all tables that have the prefix
old_
:echo "show tables like 'old_%';" | mysql --user limesurvey --password=${PASSWORD} --skip-column-names limesurvey | while read table ; do echo "Dropping $table..." ; echo "drop table $table;" | mysql --user limesurvey --password=${PASSWORD} limesurvey ; done
Update the backup of the database to overwrite the previous one:
sudo /usr/sbin/backupninja --now --debug --run /etc/backup.d/10.mysql