Filed Under (Articles, WordPress) by DK on 25 September 2007

Roland Rust runs http://wordpress.designpraxis.at and we are pleased to introduce him as our guest blogger today! In this post he discusses WordPress backups with one of his excellent plugins, "BackupWordPress". This plugin really makes it easy not only to backup your entire blog (including files) but also to restore it with the click of a button.

» A little about Roland

Roland’s website is dedicated to WordPress, WordPress plugin development, web development and open source software in general. He has been working as a self employed IT consultant since 2000 developing web based applications, multimedia datbases, multi-user portals and web 2.0 web-services.

» Intro

With a plugin like BackUpWordPress, doing backups has become an easy task. Both WordPress and BlogSecurity stress backups constantly and usually point it out as the first thing you should do when upgrading your WordPress installation or doing any significant changes.

Let’s say you’ve got a website running on WordPress 2.2.2 and are about to upgrade to WordPress version 2.3. How can you assure that your WordPress website will run flawlessly after upgrading?

» Step One

backupwordpress plugin

Download and install BackUpWordPress, if you run into troubles while getting it to work, find help at the support forum. Select the full backup option with includes SQL-dump (database backup), files and directories.

Download the newly created "full backup". If you want to verify your backup has been completed without errors, have a look at the backup log in AdvancedMode of BackUpWordPress: Click on the "view" link at the backup listed on the "Manage Backups" screen.

» Step Two

XAMPP4linux

Let’s do a complete offline mirror of your WordPress website. Create an offline development environment, follow the instructions I give in this article. In short, you need to install WAMP5 or XAMPP (on Windows or Linux) or MAMP (on Macintosh). Unpack your backup archive and move the contents of the directory named "wordpress_files" into the webroot of your localhost.

Most Apache-MySQL-PHP development environment solutions like those mentioned above come with phpMyAdmin and other database management tools. You will need to create a database and a database user identical to those on your webserver. Alternatively you can change your offline wp-config file.

Import your wordpress.sql which still resides within your unpacked backup archive into MySQL. I recommend bigdump for this. Take your time for any tasks you perform with phpMyAdmin or bigdump. Read documentations first!

» Step Three

Congratulations! Now you have an identical version of your current WordPress website on your local machine. Before you proceed any further, use phpMyAdmin to execute the following SQL statements:

UPDATE wp_options SET option_value = ‘http://localhost’ WHERE option_value = ‘[your_blog_url]’;

UPDATE wp_options SET option_value = ‘http://localhost’ WHERE option_value LIKE ‘[your_wordpress_url]’;

Where you have to exchange [your_blog_url] and [your_wordpress_url] with the respective URLs from your WordPress website’s general options. Unless you do this, you’ll be redirected to your online version with every click on your offline version.

Deacivate all plugins which are not essential for your website to run before proceeding to step Four.

» Step Four

Download WordPress 2.3 (Currently release canditate is available), unpack and copy the files into your localhost’s webroot. Browse to http://localhost/wp-admin/upgrade.php and follow the instructions. Now you can browse through your WordPress website offline upgraded to version 2.3 and check for issues. Activate your plugins one by one and test your site thoroughly.

» Step Five

Be sure you have a complete backup of your blog and repeat step four with your production website online. Use a plugin like Demo Mode to prevent access to the site while upgrading. If your online WordPress installation resides in a seperate directory, I recommend creating an untouched online copy. If you screw up, you can simply rename this directory again.

You’re done!

» Notes

I know that these 5 Steps just roughly resamble one possible solution of how to do a failsafe upgrade of your blog. At least that’s the way I use to do it, which doesn’t mean I am never runn into trouble during the upgrade process. In fact with every release of WordPress I upgrade more than 20 different installations of WordPress, each hosted on a different webserver with different configurations. Therefore I am used to running into troubles.

Here are a few issues that I ran into along with solutions and workarounds :

Problem: The offline copy of your WordPress site on http://localhost gives an internal server error 500

Solution: Delete the .htaccess file of your offline version and set your permalinks to standard permalinks without URL rewriting. This doesn’t affect upgrade process on your online production site at all, since URL-rewriting works online with your current WordPress installation.

Problem: I get “Fatal error” messages on my offline copy of WordPress.

Workaround: deactivate some more plugins that might be the source of the problem. Especially plugins using the table post2cat like sideblog cause such errors. Remove respective template tags as well.

Problem: I still get Error messages all over my offline website.

Solution: Choose the default theme, to seperate issues caused by the WordPress 2.3 core upgrade from issues that might derrive from incompatibilities of you WordPress Theme with WordPress 2.3

Problem: I can’t seem to get an offline copy of my blog to work at all.

Solution: Try to find help at the official WordPress Support Forums.

Problem: Should I risk to upgrading my online WordPress installation without being able to test it offline first?

My Answer: No! Never! Try to get help with your offline install first. WordPress 2.2.2 is stable and there is no reason why you shouldn’d take your tie upgrading to 2.3

Read and Contribute to BlogSec News!

Comments

David Kierznowski on 25 September, 2007 at 7:25 am #

Roland, as I’ve mentioned to you before, I think your WordPressBackup plugin rocks man as well as some of your other projects, nice post, keep it up.


Roland Rust on 25 September, 2007 at 7:47 am #

Thanks David, I just realise a minor mistake in the last sentence of my article, which nevertheless might lead to confusion. WordPress 2.2.2 has some security issues and shouldn’t be considered as safe/stable. WordPress 2.2.3 is the latest bug-fix release and should be used.


[…] choose to write “5 Step Failsafe upgrade for WordPress“, since WordPress 2.3 is near and everybody wants to upgrade failsafe of course. Thanks David […]


[…] Blog Security has an article on 5-step Failsafe upgrade to Wordpress […]


Upgrader WordPress en 5 étapes sécurisées on 25 September, 2007 at 12:42 pm #

[…] des plugins et des thèmes que l’on utilise et cette nouvelle version, voilà que BlogSecurity publie une contribution intéressante de Roland Rust au sujet de la sécurisation de […]


Living Better » Preparing to upgrade WordPress to 2.3 on 25 September, 2007 at 1:19 pm #

[…] WordPress. For 2.3, read “Struggling with Wordpress 2.3” and Notes section of “5 Step Failsafe upgrade for WordPress“. This is first time I backup database for upgrading 2.3-RC1. I didn’t backup for […]


[…] BlogSecurity » 5 Step Failsafe upgrade for WordPress *** Random Post *** […]


Insecure Way to Upgrade to WordPress 2.3 » Alex Concha on 25 September, 2007 at 3:40 pm #

[…] the world are sharing their upgrade experiences. The one that caught my attention was the “5 Step Failsafe upgrade for WordPress” published at […]


[…] followed my own 5 Step Failsafe upgrade for WordPress and upgrade was successful. Offline. When repeating the required steps with my production system, I […]


Wordpress 2.3 Reference Checklist | Pinoy Problogger on 26 September, 2007 at 3:41 am #

[…] Failsafe Way to install Wordpress 2.3 […]


BackUpWordPress 0.3.2 security fix on 26 September, 2007 at 9:13 am #

[…] writing “5 Step Failsafe upgrade for WordPress“ for BogSecurity, BackUpWordPress has becom a little bit more popular. This brought up some […]


WordPress 2.3 Officially Released : Average Joe Blogger on 26 September, 2007 at 8:11 pm #

[…] & General Preparing for WordPress 2.3 5 Step Failsafe upgrade for WordPress How to Switch from Ultimate Tag Warrior to WordPress 2.3 Tagging Wordpress Update Causes Privacy […]


Doug Smith on 27 September, 2007 at 4:11 pm #

I put together a plugin that will scan through other plugins and themes to look for potential conflicts with WordPress 2.3. It may be of help to others in their upgrade process. You can find it here: Upgrade Preflight Check.


David Kierznowski on 27 September, 2007 at 6:19 pm #

Doug, great stuff man! We’ll definately put something up on this.


Aaronontheweb on 7 October, 2007 at 9:57 pm #

That BackUpWordpress plugin managed to consume 1 gig of hard drive space on my server and effectively crash my blog for about an hour today. My website’s total size is about 130megs normally, but the BackUpWordpress plugin running on IIS 6.0/Windows Server 2003 tried to create three or four backups concurrently, non of which were compressed.

I guess it assumes to index all folders in the root WordPress directory, so it proceeded to try and backup all of the projects in my “lab” directory, which includes several other full-sized blogging engines and large binary files totally unrelated to WordPress.

Have you tested this plugin with IIS? If not, please don’t recommend it as a catch-all solution for WordPress backup if it doesn’t work on all environments that WordPress supports. And please make it clear that it does indeed index all folders within the WordPress root, not just the wordpress specific folders (wp-content, wp-include, wp-admin), which is what I assumed it did.


DK on 8 October, 2007 at 9:12 pm #

Aaron, no we did not test it on IIS 6.0. Thanks for bringing it to ours (and readers) attention. I am sure Roland will find this interesting.


[…] of, for example, how to backup your data more safely and thoroughly, such as this article : “5 Step Failsafe upgrade for WordPress” recommend you creating an untouched online copy. I learned this lesson because I was forgot […]


moralito on 8 November, 2007 at 4:55 pm #

thank for reading

i tried to follow the tutorial, but i got a mistake, when i try to activate the plugin (BackUpWordPress), i get a error, i get this:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 24576 bytes) in

C:\AppServ\www\wordpress\wp-content\plugins\backupwordpress\bkpwp-classes\manage_backups.php on line 197

could you help me


Philipp on 8 November, 2007 at 6:47 pm #

Sorry moralito, we aren’t the developers of that Plugin, therefore we don’t provide Support. Anyway I would think that the Process needs more RAM, than your Server can currently offer. Try to restart your Webserver(if you’re able to do so) Or try it later again. If the problem persists contact the developer or ask your Hostingcompany for help.


[…] que primero hagan pruebas locales antes de actualizar sus blogs, pueden seguir el artículo “5 Step Failsafe upgrade for WordPress” para esto, pero sólo tomen en cuenta los últimos cuatro pasos (por ningún motivo realicen […]


[…] BlogSecurity - Blog Archive - 5 Step Failsafe Upgrade for WordPress […]


[…] BlogSecurity - Blog Archive - 5 Step Failsafe Upgrade for WordPress […]


[…] BlogSecurity - Blog Archive - 5 Step Failsafe Upgrade for WordPress […]


[…] BlogSecurity - Blog Archive - 5 Step Failsafe Upgrade for WordPress […]


[…] BlogSecurity - Blog Archive - 5 Step Failsafe Upgrade for WordPress […]


Upgrading to WordPress 2.5—WP Project   on 16 March, 2008 at 8:37 pm #

[…] 5 Step Failsafe upgrade by Roland Rust. This article was written with upgrading to v2.3.3 in mind, but it contains some valuable info that you may appreciate. […]


[…] BlogSecurity - Blog Archive - 5 Step Failsafe Upgrade for WordPress […]


[…] teman2 yg hendak upgrade ke versi 2.3, artikel dari blogsecurity.net berikut ini yg membahas 5 langkah aman untuk upgrade WordPress ke versi 2.3 akan sangat membantu. Inti dari […]


Comment
Name:
Email:
Website:
Message: