Yesterday we talked about how to access your WordPress site via FTP – today, we’ll talk about something more important: Upgrading or reinstalling WordPress using FTP instead of the WordPress backend.
Again – this all comes down to saving your own butt. If an automatic upgrade fails in the middle, you’re in trouble – chances are that some, but not all of the files necessary have been reinstalled/updated. Because of this, the Dashboard is often left inaccessible, and you have to fall back on your old friend FTP.
Other reasons you might do this:
Back up your site before you do this. Please. If you mess it up, and lose all your uploads, you’re going to be really mad, maybe at me. Don’t have a backup service? Good news – I have one that I can shamelessly plug. Check it out at the front page.
Lets get to it. Since we already understand how to access WordPress via FTP, we can get started without fear.
WordPress.org has a handy feature: the latest version of WordPress is always available at:
If you ever need a copy, just enter that address in the url, and it will start downloading. The more traditional page for finding your download is here:
Need an old version of WordPress? They’re nice enough to keep those around too:
So you’ve downloaded the version of WordPress you need. Good work!
Next, you need to extract the zip you downloaded. Hopefully this isn’t too tricky – as long as you know where your downloads end up. In most cases, it’s as simple as finding the zip file and double clicking it. You should end up with a folder titled “WordPress”, which has the entirety of a WordPress install inside of it.
All that’s left is to upload. Now – you need to take some special consideration before you just go uploading all these files. Make sure you’re:
That deserved to be bolded. The wp-content folder holds your themes, plugins, and uploads – and we don’t want to overwrite it with the default wordpress content. So, we’re going to upload everything except that.
Now, this is going to take a while – WordPress has a lot of files. Go eat a sandwich, it will be done when you get back.
Now head back over to your site and get a feel for your handiwork. If you were just trying to fix a problem, ideally at this point your site is working again. If the upload went ok, and your site still isn’t working, the problem lies somewhere else – check your plugins and themes if you haven’t already.
If you were doing this to upgrade your WordPress install, you’ve got one more step. Head over to yoursite.com/wp-admin, and you should be presented with a screen saying you need to upgrade your database. Go ahead and approve that, give it a minute to think, and you should be redirected to the login page – and you’re done!
FTP is short for File Transfer Protocol. Pretty self explanatory – you have files on your computer, you want them on your website, so you transfer them. FTP facilitates this.
Like I said, WordPress continues it’s relentless path toward becoming completely free of scary acronyms like FTP, but there are still times when you need it – mostly when things go wrong:
Step 1: Get an FTP client.
“FTP Client” is just nerdy talk for “Program you use to upload your files to your website”. There are as many FTP clients as there are fish in the sea, but I’m just going to tell you to use FileZilla, because it’s free, and easy to use. Download and install it, and get back here.
Step 2: Figure out your FTP credentials.
More nerd speak – you just need the login and password (and maybe ftp url) your host gave you for FTP access. This information is often in your “Welcome to your new hosting account” email.
Step 3: Connect!
Alright – fire up your FTP Client (See? You’re talking like a real nerd! Drop that one on your boss. He’ll give you a raise and a new job title.) In filezilla, we’re just going to use the “QuickConnect” bar –
Host: This is usually your site’s url (like codegarage.com), but sometimes it’s something different. If it’s different, they’d have told you in the same place you found your username and password. You did find your username and password already, right?
Username: Your username. Take note: you might have to include the domain name afterward, like an email address (like email@example.com).
Password: Your Password.
Next stop, the “Quickconnect” button. Go ahead, click it. You’re not in a position to break anything. Yet.
Hopefully. If not, you’ve probably got one of those fields wrong – host, username, or password. Do some tinkering.
If you got in, you’ll see the window on the bottom right corner of the screen fill up with some folders (or maybe just a few). These are the files on your server! Go ahead, do some exploring. When you’re ready to upload a file (send it from your computer to the website), just drag it on into that window on the right, and it will get sent to the website.
That’s it! Good work!
I do all of the development work for an SEO/MMO program over at thekeywordacademy.com. As part of the program, we’ve put together a system that facilitates guest posting on other members’ sites easily. That’s all well and good – but one problem we run into fairly often is this: For whatever reason, the posts table on a site goes down, and the owner’s posts are all suddenly gone – without a trace. Naturally, they get pretty worried, and an email shows up in my inbox (or in our forum).
The good news is: it’s almost always just a simple myIsam crash – easy to fix, and no data loss. After going through this a number of times with various members, I decided I really ought to put together a quick tutorial on how to fix it.
First – how do you know this is the issue you’re seeing? The most obvious symptom is this: Your posts have just disappeared. The homepage of your blog is giving a 404 (but a pretty one, with your theme), or just telling you it can’t find any posts. You log into your dashboard, and much to your dismay, the edit posts screen is showing not ONE single post. It’s terrifying, because it’s at exactly this moment that you realize you never installed that backup plugin (or more likely, you started to, but never finished, because it got tricky). Much cursing later, you’ve resigned to the fact that all is lost.
Of course, it’s likely that all is not lost – lets look at how to make sure.
To get this done, you’re going to need to get direct access to your database somehow. There are a number of ways you can do this, ranging from the super nerdy (command line/ssh access), to the moderately nerdy (MySQL gui client like Sequel Pro), to the entirely accessible – the web based interface of phpMyAdmin. I havent run across a host in recent times that doesnt give you access to phpMyAdmin in some form, so that’s what we’ll use here.
First, you’ll need to get into phpMyAdmin. I can’t give you much help there, because it’s a different process with every host. If you’re having trouble, get to your control panel, and just start searching for things – start with “phpMyAdmin”, but if you can’t find that, move on to “MySQL”, “Database” – things of that nature. You’re bound to get on the right track soon enough.
Once you’ve got phpMyAdmin opened up, you’ll end up at a screen that looks vaguely like this:
On this main page, you’ve got a list of databases off to the left, and lots of information and settings you don’t need to worry about in the center. You need to choose the database that is running the WordPress install in question off on that left column, and click to open it up. (If you’ve got a number of WordPress installs on one server, this could be a bit tricky. Check out the settings in your wp-config.php file if random guessing doesn’t do the trick).
Now that you’ve chosen your database, you’ll see the list on the left has changed – now you’re looking at tables inside the chosen database instead of databases. Click on the wp_posts table to open it (note – it’s possible that this is something other than wp_posts, especially if you’ve got multiple installs in one database. The table you want will definitely end in “posts”, and whatever comes before that can be found in your wp-config.php file – look for “$table_prefix = “). Clicking on the posts table will either pull up a page describing the contents of the table, or an error message, that looks something like this:
Surprisingly, this is good news. Your precious posts are just one command away.
Finally, the juicy bits. To repair the table, we’re going to need to run an SQL command on the database – and to do that, we’ll click the “SQL” tab near the top of the page. Doing so should bring up a page with a box that looks something like this:
As shown in the screenshot, you need to enter this:
repair table wp_posts;
In case you hadn’t guessed – if your table didnt start with wp_, you need to adjust that command accordingly.
Double check that you’ve typed the command in properly, and hit “Go” (bottom right of the input box). If all went well, a moment of loading later, you should be presented with this screen:
And with that, you’re back in business. Check your site, and your posts should be back. In some cases, the wp_posts table isnt the only one that goes down, so as long as you’re in phpMyAdmin, you might double check to see if any of your other tables need some TLC from your newfound database administration skills.
On the off chance that none of this worked, the table wasn’t crashed, or repairing it didn’t fix the problem, there’s a fair chance you’re in serious trouble. For problems with that, or any questions along the way, get in touch here, or drop me an email.
Update – All this post disappearing have you hankering for some backup help? Have a look at this post about How to back up your WordPress blog