Twice now I’ve updated wordpress, only to realise that (facepalm) it overwrites some changes I’ve made to the custom template – to sidebar or something similar.
Obviously I don’t HAVE to update, but it’s better to for add-ons etc, and I like having the latest products and bug fixes.
What are other people’s strategies for straightforward updates to wordpress without losing custom modifications to the default template?
Very simple : if you use the default template, rename it folder name and css file declaration) and it won’t be updated.
If you want the updates (for instance the Twenty One is often updated), create a child theme.
Infos here : http://codex.wordpress.org/Child_Themes
First: You should never make changes to the WordPress core files, instead, write a plugin to do it for you.
Second: If you have only minor to moderate theme customizations, you can use a child theme, thus leaving the core files alone. Alternatively, rename the theme folder so that your changes aren’t wiped out by the update.
I do not use the Dashboard updater.
I install WordPress using Subversion; all my local modifications can be shown with
svn diff
and in most cases they are seamlessly merged with the new codebase when I switch to a new release number. The core and many plugins and themes are available through SVN. Not all unfortunately, but that still leaves you with an out: create a repository so that you never lose changes even if you use the automatic updater on a plugin. Obviously some strong VCS skills help here. 🙂http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion
Keep your copy of your modified code-base in a source control system. I recommend mercurial.
Drop the original version of the wordpress code that you went on to modify into mercurial and commit it. Then drop your modified codebase over the top of it and commit it while giving it a branch name. Call the branch ‘oursite’, whatever.
The point is, mercurial now knows how your site differs from the standard distribution. This makes upgrades easier.
When the next version of wordpress comes out, download it and drop it over the top of your local mercurial working directory. Just make sure you ‘update’ that working copy to the default branch, ie not your ‘oursite’ branch. Mercurial now knows how the new wordpress version differs from the previous one. Mercurial is very good at merging the differences from two ‘child’ versions of a common ‘parent’ and more often than not, your custom tweaks will be incorporated fine.
Even my custom theme gets updates every now and then. I download it locally first and do a compare using BeyondCompare to see where the changes are, and if I can safely skip the files where my custom changes were made. If not, I manually update the source files before uploading it to my site. This is a bit of extra work, but required if you’ve made custom changes to your theme/site.