====== Backing up a dokuwiki site to git ====== * Look up advice on keeping this wiki site backed up to a source code repository, in this case git LInks: * [[https://tom-henderson.github.io/2015/04/08/dokuwiki-github.html|Dokuwiki to github backup]] * simplest way to back up dokuwiki would be to use GitHub, with the added advantage of having versioned backups. * Steps to back up dokuwiki: * use GitHub - or BitBucket (BitBucket repository would also for Mercurial backup) (Question:Would it be possible to use visual studio team repositories?) * Add new machine user to our GitHub account * set up machine with ssh keys * create new repository * push current state of the wiki to it. * add simple nightly cron job to commit and push any changes. * Tom recommends this script: #!/bin/bash cd /var/www git commit -a -m "Wiki backup $(date +%F-%s)" git push * if nothing has changed, nothing is pushed * Advantage of being in git: all the dokuwiki pages are text files, so the complete documentation of the wiki is viewable from Git. Same if the backup was in Mercurial on BitBucket (BitBucket also accepts git repos). * Advice on Dokuwiki site about backup https://www.dokuwiki.org/faq:backup * Has advice on restoring, and extras like how to run two copies of dokuwiki side by side out of the same web hosting domain, out of same folder. * What to backup: * must backup these following directories: * data/pages - contains your current pages * data/meta - contains meta information about your pages (like who created it originally, who subscribed to it, …) * data/media - contains your current media (images, PDFs, …) * data/media_meta - meta data for the media * data/attic - all the old versions of your pages * data/media_attic - all the old versions of your media * conf - the configuration settings * can exclude these directories: cache, index, locks, and tmp