====== Upgrading DokuWiki ======
Note: if you installed DokuWiki through your Linux Distribution's package manager (eg. using a [[install:Debian]] or [[install:Fedora]] package) or similar tools you should also use the same package manager to upgrade your DokuWiki. Descriptions on this page are meant for standard, manual installations as described on the [[:install]] page only.
DokuWiki is very simple to upgrade. Its file layout is organized in a way that avoids overwriting any user content, which means an upgrade generally is just unpacking a new version on top of an old one. You should first try the simple instructions given here, if you encounter problems or the instructions are not detailed enough for you, read the details in the section below. Mac users should use Terminal; copying files via Finder will delete all data.
* **Step 0:** Make sure your server meets the [[:requirements]].
* **Step 1:** Make a [[:faq:backup]] of your DokuWiki, this is not necessarily needed but recommended
* Example:\\ tar zcpfv dokuwiki-backup.tar.gz /path/to/dokuwiki
* **Step 2:** Read the [[:changes|changelog]] to see if there are any special things to consider
* **Step 3:** Download the newest release from the [[https://download.dokuwiki.org|download site]].
* cd ~
wget http://.../dokuwiki-xxxx-xx-xx.tgz
* **Step 4:** [[unpacking|Unpack]] the distribution tarball and upload/copy the files over your previous installation. Make sure to **overwrite all files** when prompted.
* tar zxvf dokuwiki-xxxx-xx-xx.tgz
'cp' -af dokuwiki-xxxx-xx-xx/* /path/to/dokuwiki/
The quotes on cp assure that it will run as is, even if an alias is set.
* Check copied files ownership and permissions (for details see [[install:permissions]]).
* **Step 5:** Delete all [[unused files]]
* **Step 6:** Upgrade your [[:template]] and [[:plugins]] if necessary
* **Step 7:** Wait a day for the update notifications to go away. Alternatively, you can speed up the process by following the steps in [[:update_check|Update Check]]
Note: Yes, we explicitly recommend overwriting your old installation. If you adhered to the advice of defining config options in *.local files only (the Configuration Manager does this automatically) your previous config settings will **not** be overwritten. The same is true for all your pages and media files. Using the overwrite approach will save you a lot of trouble with keeping page revisions correctly working as these are depending on file modification time-stamps.
===== Pitfall on suhosin php extension =====
DokuWiki version since 2015-08-10 "Detritus" requires some special settings in [[https://suhosin.org/stories/index.html|suhosin php extension]] (if installed), otherwise edit page and plugin update/install won't work. Please refer to [[:install|DokuWiki Installation]] for detailed instruction.
===== Troubleshooting =====
The following pages should give you hints on common post-upgrade problems:
* [[:caching]] -- purge the cache if things look strange or error messages appear
* [[config:updatecheck]] -- if update notifications persist
* [[faq:toolbar]] -- Quickbuttons and JavaScript problems
* [[faq:searchindex]] -- if search box gives you no result
If you get errors about missing/non-writable directories, you probably didn't read the [[:changes|changelog]] carefully enough. When upgrading to Angua you need to create two new directories and make them writable:
* ''data/media_attic''
* ''data/media_meta''
===== Alternative Ways =====
Here are a few different upgrade descriptions, provided by users. They might be slightly out of date.
* Use [[plugin:upgrade|Upgrade Plugin]]
* [[.:diffupgrade|Upgrading by creating diffs]]
* [[http://installatron.com/dokuwiki|Upgrading using Installatron Applications Installer]]
* [[http://apscatalog.com/1/splitbrain.org/dokuwiki/|Upgrading by APS]]
* [[http://home.komsys.org/~jocke/upgrade-dokuwiki.txt|Upgrading using common Linux commands (copy-paste commands)]] [missing on server]
* [[http://falstaff.agner.ch/2010/08/12/using-git-to-install-dokuwiki/|Installing and upgrading via git]]
* **New!** Use the [[update_helper:|DokuWiki Update Helper Script]] to automate the upgrade process.
===== Upgrading an Old Distribution =====
When upgrading from a distribution which is a few or more years old, it is best to upgrade in stages, one year at a time, using the steps described above. You can get old distributions from the [[https://download.dokuwiki.org/archive|download archive]].