Drupal Upgrades - Logged Out/Stuck in Offline Mode?

Tonight I upgraded realjenius.com to Drupal 5.2, and I was hit with an interesting problem for the 2nd time - after upgrading my site, I went to update.php (as per the upgrade instructions) and was confronted with an ‘Access Denied’ error. The instructions are clear that you should stay logged in as an Admin during this process, and I assure you, I was, but for whatever reason no matter how many times I do these full Drupal upgrades, I lose my login access after the upgrade.

The upgrade instructions are fairly clear on what to do if this happens. All you need to do is crack open update.php with a text editor and follow these instructions:

  • There is a line near top of update.php that says $accesscheck = TRUE;. Change it to $accesscheck = FALSE;.
  • As soon as the script is done, you must change the update.php script back to its original form to $access_check = TRUE;.

Unfortunately, that only gets you part of the way. After you finish the updating process, you will be taken to your ‘Site Offline’ page, instead of to the admin module. Oh dear, now we have a problem. You can’t get to the admin page, because you aren’t logged in as the admin anymore.

Thankfully, Site Offline doesn’t totally cover every URL (although, you may have tried http://yoursite.com/user/login with no success). If all else fails, the best URL to hit is: http://yoursite.com/?q=user

This will take you to a login, at which point you can begin turning everything back on. Voila!

Comments

Thanks!

Thanks for the tip, I ended up hitting this problem today, and this solved it.