====== Upgrading by using diff/patch ======
This page describes how to create patch files to upgrade DokuWiki from one Version to another. The advantage of that method is that it will keep modifications you may have made to the DokuWiki core code.
The following description assumes a Linux system. You may need to adjust it for different Operating Systems.
===== Creating the patch file =====
To create a patch file, you need to download two fresh, unmodified copies of DokuWiki. One matching the version you are currently running and one of the version you want to upgrade to.
Create a directory for temporary use, and change into it:
$> mkdir WikiUpgrade
$> cd WikiUpgrade
Download the two versions of DokuWiki, your current and the version you desire to upgrade to
$> wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2005-07-01.tgz
$> wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2005-07-13.tgz
Unpack tarballs:
$> tar -xzf dokuwiki-2005-07-01.tgz
$> tar -xzf dokuwiki-2005-07-13.tgz
Now a patch can be created using the [[man>diff]] utility:
$> diff -Naur dokuwiki-2005-07-01 dokuwiki-2005-07-13 > doku.diff
===== Applying the patch =====
To apply the patch file you created in the previous step, change into your real wiki directory and run the [[man>patch]] tool.
You may first want to do a test run to see if any conflicts may happen and what files are affected:
$> cd wiki
$> patch -p1 <../doku.diff --dry-run
patching file VERSION
patching file conf/wordblock.conf
patching file inc/actions.php
patching file inc/io.php
patching file inc/lang/cs/admin.txt
patching file inc/lang/cs/admin_acl.txt
patching file inc/lang/cs/lang.php
patching file inc/lang/en/lang.php
patching file inc/lang/no/lang.php
patching file inc/parser/handler.php
patching file inc/parser/xhtml.php
patching file inc/template.php
patching file lib/exe/spellcheck.php
patching file lib/scripts/spellcheck.js
When you're happy, apply the patch:
$> patch -p1 <../doku.diff
patching file VERSION
patching file conf/wordblock.conf
patching file inc/actions.php
patching file inc/io.php
patching file inc/lang/cs/admin.txt
patching file inc/lang/cs/admin_acl.txt
patching file inc/lang/cs/lang.php
patching file inc/lang/en/lang.php
patching file inc/lang/no/lang.php
patching file inc/parser/handler.php
patching file inc/parser/xhtml.php
patching file inc/template.php
patching file lib/exe/spellcheck.php
patching file lib/scripts/spellcheck.js
Once patch is applied, do not forget to remove updgraded version's [[install:upgrade#files_to_remove]].