Forum archive
Updating DokuWiki to weatherwax
Hi All,
I thought I should post this somewhere after I took the time to do it. I managed to update the Dokuwiki in turnkey linux from the old one to the new weatherwax.
It did this by first installing the current turnkey solution. And then sshing into the VM and executing the following instrucitons:
This got me to the new version... (It was not so simple, but I think I now follow what is going on...)
####### Turnkey linux update steps #######
# Update the version of dokuwiki in turnkey linux. Install the turnkey linux distribution as you normally would.
cd /usr/share/
# get the latest vesion
tar -zxvf dokuwiki-2013-05-10a.tgz
# copy media_attic media_meta into the place turkey stores the data
cp -r dokuwiki-2013-05-10a/data/media_* /var/lib/dokuwiki/data/.
chown -R www-data:root /var/lib/dokuwiki/data/media_*
# dokuwiki also needs these pages if they are not already there
cp -r dokuwiki-2013-05-10a/data/pages /var/lib/dokuwiki/data/.
chown -R www-data:root /var/lib/dokuwiki/data/pages
rm -r dokuwiki-2013-05-10a/conf/users.auth.php.dist dokuwiki-2013-05-10a/conf/acl.auth.php.dist # these conf settings are handled specially by turnkey
# very importantly in the new settings we have to change the default location of where the data directory is to /var/lib/dokuwiki/data which is where turnkey linux sets this up to be.
sed -i.bak "s@\(.*savedir.*\)\./data@\1/var/lib/dokuwiki/data@" /usr/share/dokuwiki-2013-05-10a/conf/dokuwiki.php
# set the correct permissions
chown -R root:www-data dokuwiki-2013-05-10a/conf/*
# remove the word block of the newer version since the turnkey version is sooo much more extensive
rm /usr/share/dokuwiki-2013-05-10a/conf/wordblock.conf
# copy over the remaining conf settings
mv -f /usr/share/dokuwiki-2013-05-10a/conf/* /etc/dokuwiki/.
# copy over the deleted files for the later cleanup
cp dokuwiki-2013-05-10a/data/deleted.files dokuwiki/deleted.files
# we have now handled the data and the conf settings
rm -r dokuwiki-2013-05-10a/conf dokuwiki-2013-05-10a/data
# copy over the rest of the new files into the installation
rsync -a dokuwiki-2013-05-10a/ dokuwiki/
# clean up
rm -r dokuwiki-2013-05-10a*
# remove all files that need to be deleted
cd dokuwiki
grep -Ev '^($|#)' deleted.files | xargs -n 1 rm -vf
rm -r deleted.files
But not to sound ungreatful, your process may have unwanted repercussions...
What you have done is overwritten an application that was installed by package management (see the DokuWiki appliance page) with upstream software. Whilst it has acheived your ends for now it is not good practice and not recommended. /usr/share should be handled exclusively by package management and should not be manually written to.
You may have a completely legitimate reason for wanting a newer version but doing that has implications (even if you do it the right way).
First thing to consider is why do you want a newer version? If it's for features or bug fixes then that is totally legitimate and reasonable reason. If it's to avoid security issues then not so much... Packages from the official Debian repos are 'frozen' at a particular version number but security fixes are backported (generally these are released quite soon after the security issues are made public). And that brings us to the reason why overwriting applications installed by package management with upstream source is a bad idea...
You server doesn't realise what you've done, it still thinks that you have the Debian package from the repos installed. So if a new (security bugfixed) version appears in the repos, your system will automatically install it (over the top of your new version). In a best case scenario, this will put DokuWiki back to an 'older' version and things will continue as normal (although you will be back where you started). But more likely if things have changed significantly between the versions it will break DokuWiki and it will display incorrectly; or worse still not work at all...
If you are using TKLBAM then a restore to a new server will acheive the same result.
So if you do wish to go ahead with a newer version of DokuWiki than what the TKL appliance comes with then I would highly recommend that you start with the LAMP appliance and install it as per upstream instructions. The LAMP appliance should be good to go, although you may need to install PHP-GD and Image MagicK (as per notes here - I don't think they are installed by default on TKL LAMP). You can install them with apt (search using apt-cache search; then install with apt-get install).
The other bonus of doing it that way, is that if you use TKLBAM, then your backup (whilst being a little larger than the default DokuWiki TKLBAM backup) should work perfectly on restore.
To minimise backup size it may be worth checking to see where DokuWiki stores it's cache and exclude that from your backup...