Wordpress Maintenance

Wordpress Upgrades

We use the Wordpress cli tool to upgrade Wordpress.

N.B.: There already is a nightly database backup running.

Login:

ssh capitularia@capitularia.uni-koeln.de
cd /var/www/capitularia.uni-koeln.de
./wp help

Upgrade the cli tool:

./wp cli update

Upgrade Wordpress:

./wp core update
./wp theme update --all
./wp plugin update --all

qtranslate-xt

The plugin qtranslate-xt needs manual update:

cd /var/www/capitularia.uni-koeln.de/wp-content/plugins/
wget https://github.com/qtranslate/qtranslate-xt/archive/3.6.2.zip
unzip 3.6.2.zip
rm 3.6.2.zip

Replace “3.6.2” with the latest version.

Then go to the Wordpress admin page and then to Plugins ‣ Installed Plugins, deactivate the old version and activate the new version of the plugin.

wordfence

The plugin Wordfence needs write access to the location /var/www/capitularia.uni-koeln.de/wp-content/wflogs. The wp commandline update tool also needs access to that location during plugin update. So both users www-data and capitularia have write access to that location.

getfacl wflogs
# file: wflogs
# owner: capitularia
# group: capitularia
user::rwx
user:www-data:rwx
user:capitularia:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
default:user:www-data:rwx
default:user:capitularia:rwx
default:group::r-x
default:mask::rwx
default:other::r-x

Restore Database

Restore the Wordpress database from the backup.

mysql < /var/backups/mysqldump.backup

Note: The database contains all Wordpress settings. After restoring the production database on a developer machine, the Wordpress settings must be adjusted.