Roughly following dokuwiki's own upgrade instructions page:

  1. SSH to the server
  2. Take a backup, e.g. sudo /var/services/backup_dokuwiki.sh
  3. Download the latest Dokuwiki release wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
  4. Extract it, tar xzf dokuwiki-stable.tgz
  5. Copy files into place (NOTE you will need to use the actual path, including the new version number): sudo 'cp' -af dokuwiki-2024-02-06a/* /var/services/dokuwiki/
  6. Fix permissions: sudo chown -R www-data:www-data /var/services/dokuwiki
  7. Check the version number at the bottom of the Dokuwiki admin page

The Dokuwiki docs also recommend deleting unused files:

  1. Check what would be deleted: cd /var/services/dokuwiki && grep -Ev '^($|#)' data/deleted.files | xargs -n 1 rm -v 2>&1 | grep denied
  2. Run the actual deletion: cd /var/services/dokuwiki && grep -Ev '^($|#)' data/deleted.files | xargs -n 1 sudo rm -vf