views:

63

answers:

4

I never know what to do when my Wordpress installation tells me there's an update available. I am using version 2.8 so whenever there is an update, all I have to do is click update, some magic happens behind the scenes, and it gets updated. But should I create backup files? And how? I have custom themes and plugins that I don't want to get lost because I don't have backups! Is it safe to assume that nothing bad will happen when you click the upgrade button? What is your process when you decide to upgrade to the newest version?

+3  A: 

Backup the database, wp-content directory and configuration files first.

There are plug-ins to make this easier, but since you're asking on StackOverflow, I'll assume you could write a script to do it yourself. While you're at it, add the script as a cron job.

http://codex.wordpress.org/WordPress%5FBackups#Backup%5FResources

Jeremy Stein
A: 

Always backup before making a big change like that.

You'll want to copy all your files to a safe place via FTP. Copy 'em, zip 'em up, and keep them somewhere safe where you can remember where they are. You'll also want to backup or "export" the database and keep that also safe. This way if something goes wrong, you can restore it to the way it was.

McAden
A: 

There's a good backup script here for Wordpress sites:

http://www.guyrutenberg.com/2008/05/07/wordpress-backup-script/

based on Bash and bzip2.

Jon
A: 

I usually don't update nothing in production without testing it first, unless is a simple modification and is about security (like the 2.8.4 update).

The ideal thing to do is create a separate installation to be a test server: can be in your local machine, or just a whole different installation in your server. Why? Remember you have plugins installed and some may break, updating everything can't be a "blind" decision!

So, before updating in the production installation/server, always test in the "test environment".

Nothing is worse than having your website down because of an update error.

GmonC
Have you actually done this? I've tried to get Wordpress to run in a test environment, and it requires some serious hacking. The database has references to the production domain. The test site will link you to the production site.
Jeremy Stein
You start developing local in your development environment and source control versioning system. To send your application to your production site, you have 2 options: one is changing wp-configs.php and blog domain in database everytime you export to production, by hand. Other one is creating a version control structure that has 2 config files and create a deployment script that when you send it to the server, it picks up the production wp-config. Of course, this is just a summarized way of one way of using a version control system like subversion with wordpress and deployment.
GmonC