Tuesday, May 27th, 2008
Which Files and Folders Should You Replace When Upgrading Your WordPress Blog?
Ayub, a friend from Uganda, wrote to me yesterday for help with his blog:
Please come to my rescue. I tried upgrading my blog by deleting the files and uploading new WP files and folders. It upgraded, Yes BUT now, It has dropped the Side bar to the bottom of the page.
I checked his blog with all the browsers I have installed on my MacBook, but I didn’t find this problem he reported. I even used Browsershots to test the site in 63 different browser / OS combinations — but I didn’t find any problem either.
So I supposed he must have fixed it himself.
However, I found that all his images were missing! That made me immediately suspect he had deleted them while upgrading his blog. I asked him, and this is what he wrote back:
Thanks for the quick turn around. That 2nd last paragraph [referring to my mail to him] about not removing the WP-Content folder made me smile. I realy felt like I was talking to you face to face. It is so like your usual statement
Thanks.
—- snip — snip —
Yes, I deleted everything, including the WP-Content folder.
Wow, I thought as much!
So which directories (aka folders) and files should you actually replace when upgrading WordPress? Which ones should you leave alone?
The short answer is: replace everything, except one file (wp-config.php) and one folder (wp-content). I also suggest you actually delete all the other files and folders and upload the new ones, instead of simply overwriting them.
And now for the long answer…
WordPress is a database-driven content management system. Mouthful eh? That simply means all the text that you sweat to write are not stored within the WordPress files you install.
Rather, they are stored in the database. Remember you had to supply some MySQL database name, username and password at the time you were installing WordPress? Right — that’s where all your articles you write are stored.
However, all your media files (photos, audio, video, pdf files, etc) that you upload when writing articles are stored (by default) in a folder called uploads in the wp-content folder. Your WordPress theme and all plugins your’re using are also stored in this same wp-content folder.
So unless you want to totally clear your blog and start over on a fresh, blank note, leave this directly alone when you’re upgrading WordPress.
Also, the information that allows WordPress to connect to your database to display your articles are stored in the file named wp-config.php. Don’t delete this file as well.
And most importantly, always, always, ALWAYS… do a complete backup of your WordPress blog before starting any upgrade.
By “complete backup” I mean backup your database and all WordPress files and directories — including wp-content and wp-config.php. This way, you can easily restore your WordPress blog to its previous state in case something goes wrong during the upgrade.
If you’ve got a question about upgrading your WordPress blog, I’m always here to help. Leave a comment below, shoot me an e-mail, call, text, IM or leave a voicemail, or or head over to the Chat Room for a live discussion.
Looking for more? Sign up for my free weekly newsletter packed with even more practical guides and great tips to help you hack your way through everyday challenges and live a more meaningful life.
