How to Fix WordPress Upgrades – “Briefly unavailable for scheduled maintenance”

Today, I was greeted by “upgrade” notices on all my WordPress sites, due to the latest and greatest 3.2 release being made available.  I dutifully went through all my sites and upgraded them, then I turned my attention to my client’s sites.  One of my clients in particular uses an incredibly bad web host – in spite of my continued pleas – and when it came to upgrading their main site I must admit, I became a little nervous!  I became paranoid about having an up-to-date backup (always a good plan anyway!) and even this proved a challenge due to connectivity issues to the server!

Eventually, I hit the “Automatic Upgrade” button, and that’s when things started to go horribly wrong…!  The first thing that I noticed was that the “spinner” in my browser tab had stopped spinning, even though the upgrade clearly hadn’t finished.  I naively waited 5 minutes in the vain hope that it might be working anyway, then finally accepted that I KNEW it had failed and that no amount of willing it to complete was going to do any good.  So I decided to go back to the dashboard and have another try.

I’ve often wondered what would happen on a WordPress site if the upgrade was interrupted part way through.  Well, I got a hint of what happens when instead of seeing the dashboard as I was expecting, I was greeted with this:

Briefly unavailable for scheduled maintenance.  Check back in a minute.

It was bad enough being locked out of the dashboard – I knew I could fix it – but at least the main site was still running… wasn’t it?

I tentatively opened the main site, only to be greeted with that self same message!  Now I was REALLY panicking!

As any good techie in this situation would do, I turned to my trusty Google for help and discovered to my relief that not only was I not the first person to hit this exact problem, that it was also really easy to fix!

.maintenanceIt turns out that during the upgrade process, since WordPress 3.0 a small file is written to the root of your site called ‘.maintenance’.  WordPress uses this file to determine whether or not to display a page (whether on the front end or the back end) and for what period of time.  You can actually use it to cause the site to go down at a particular time, but that’s beyond the scope of this article today.

All you have to do to bring the site back up is to delete this file..  That’s all.  Nothing fancy.  No MySQL tables to edit.  No PHP to hack.  Simply delete the file and the site springs back into life.

In this particular case, when I attempted to go back into the dashboard, WordPress cleverly detected that I was only part way through the upgrade and offered me a convenient button to click in order to complete everything, prior to presenting me with the cool new dashboard! 

I guess the big question is: do I like WordPress 3.2???  I’ll tell you in a couple of days…! 😉

By the way, if you want to enable “Maintenance Mode” on your WordPress site, then this isn’t the way I’d recommend.  I use the simple “Maintenance Mode” plugin which you can get at http://wordpress.org/extend/plugins/maintenance-mode/

 

About The Author

John

John is a Senior Solutions Engineer for a U.S. IT company, specialising in Software Defined IT Infrastructure. He has an extensive background in IT and spends way too much time sitting at his PC's, making videos for himself and other Internet marketers and dreaming of spending more time boating. He's also passionate about Jesus.

15 Comments

  • Bakare Oluwabamise

    27th July, 2011

    Please can you help me see what help you can render to restore my site at http://www.oursavedmarriage.com, it’s been given me fatal error message? If you can help I will be greatful. Thanks
    Bakare

  • John

    27th July, 2011

    Hi Bakare,

    Has WordPress EVER worked on this domain? It seems to be completely messed up!

    It’s hard to really help you without direct access to your domain, but it looks like your server can’t run any of the PHP files for some reason.

    A couple of things to check:

    1) If you find a .htaccess in your root directory, please delete it (back it up first!)

    2) Visit this page: http://kirupa.com/web/testphp.htm and follow the instructions to test your PHP installation.

    If both of these work and you’ve never had WordPress working, then I’d recommend you simply go through the process of re-installing it. However, if you’ve had it working in the past, you’ll have to be a little more careful. Please run through the steps above and get back to me.

    Kind regards,
    -John.

  • Bakare Oluwabamise

    27th July, 2011

    Thanks for the effort at responding. I used to have some articles on the site then I wanted to change to the new upgrade of WP I think, 3.2 or so, then it went awry. i cant even access my admin area, so nothing I could access. What else can I do? Thanks

  • John

    28th July, 2011

    Hi Bakare,

    You should still be able to access it via FTP to enable you to run the tests that I mentioned. If you’re not familiar with FTP, you should at least be able to get into your site control panel, which I just confirmed is at http://www.oursavedmarriage.com/cpanel. By the way, if you get a security exception, it should be fine to go there anyway as it looks like your web host has simply messed up their SSL certificates – nothing to worry about! You should have received login details when you setup the account with your web host.

    Once inside cPanel, look for something called “File Manager”. This should enable you to do everything that you can do with FTP to upload files.

    Cheers,
    -John.

  • Bakare Oluwabamise

    28th July, 2011

    Please I really appreciate your efforts at helping me out of this issue, I’ve accessed the cpanel but there seems to be a problem greater than I can resolve myself, if you wish I can send you my cpanel details so you can help me look into it yourself. Thanks

  • John

    28th July, 2011

    Hi Bakare,

    For some reason, a whole bunch of your PHP files were blank! Re-uploaded WP 3.0.5 files and all fixed now! 🙂

    God bless,
    -John.

  • Bakare Oluwabamise O.

    28th July, 2011

    I am so grateful for the effort you have put into restoring my website that has been giving fatal error since February, it was such a breeze to see it come back to life, this is something you will have charged for to fix, but you did it magnanimously. I pray that God will bless and increase you in Jesus name. Thanks sir.

  • John

    28th July, 2011

    You’re very welcome! 🙂

    God bless,
    -John.

  • Jan Smith

    30th July, 2011

    I also have had that dreaded wp upgrade problem. Usually it happens because of a plugin conflict for me. Then it is a matter of search and seek…so time consuming and frustrating! I also like the maintenance mode offered by word press and recommend it to be used much more frequently than it actually is. In fact, I think it is now part of the WP install, isn’t it?

    BTW, I genuinely like your site. Very nice indeed.

  • John

    30th July, 2011

    Hi Jan,

    There IS a maintenance mode within WP, but I prefer to work with the dedicated plugin, as it seems to be a little cleaner.

    -John.

  • Bakare Oluwabamise O.

    30th July, 2011

    So please what do you advise, do I make the change for the upgrade or do I leave it as it is now? I learned the upgrade is better than the old.

  • Bakare Oluwabamise

    31st July, 2011

    Please what do you think, do I upgrade to 3.2.1 from 3.0.5, that was what I did before that messed up the site. Should I upgrade?

  • John

    31st July, 2011

    It looks like your host has a problem doing the upgrade. I would recommend that you do it, but don’t use the automatic upgrade option. Instead, download 3.2.1 and upload it via FTP to your site. That should prevent re-occurrences of your previous problems.

    God bless,
    -John.

  • Bakare Oluwabamise O.

    1st August, 2011

    Thanks I will try and do that and see what happens.

  • Bakare Oluwabamise O.

    2nd August, 2011

    Whao, seems I’m overwhelmed witht the ftp thing, would continue like this till I can get a good grasp of it, thanks.