This was filed as comment 48 on #949102: Polish UPGRADE.txt by jenyum, and as per comment #50 by EvanDonovan, I'm filing it as a separate issue.

jenyum:

Not sure if this is an installation bug, or a documentation issue, but I followed the instructions in Upgrade.txt to upgrade from 6.x to Drupal 7, on a fairly bare site with an Acquia distribution. The site was automatically taken online, where I had previously set it to offline for maintenance mode. (Also ended up logged out, so had to set update.php access to TRUE) If this is automatic upgrade.txt should indicate it, from the way it is written it sounds like you should expect to have to take the site back online again when you are done. (Which is the process from Drupal 6.) If this is expected behavior I have to say I wasn't crazy about it, since the site had all contributed modules turned off and was in no way ready for traffic. If it is expected, it should be documented.

EvanDonovan:

I think open a new issue against the install system component. Then folks like DamZ, David Rothstein, catch, chx, etc. who are familiar with the upgrade path can confirm, and if it is the case, and if we can't fix it before rc1, then move the issue back to documentation component.

Comments

jenyum’s picture

subscribing. Thanks for making this an issue.

EvanDonovan’s picture

Subscribing, thanks jhodgdon!

effulgentsia’s picture

Priority: Normal » Major
Issue tags: +D7 upgrade path
David_Rothstein’s picture

Title: Upgrade from 6.x to 7.x doesn't work as documented » Upgrade from 6.x to 7.x always pulls your site out of maintenance mode immediately
Component: install system » update system

Hm, this looks like an ugly bug.

Apparently, the variable which controls the maintenance mode was renamed from 'site_offline' in Drupal 6 to 'maintenance_mode' in Drupal 7, but no one wrote any kind of upgrade path for it?

So basically, it looks like we need to (a) write an upgrade path for this variable, (b) separately make sure the correct thing happens for both sites updating from Drupal 6 as well as sites updating from a Drupal 7 beta release (the latter probably just need the old variable deleted at this point, nothing else), and then, (c) somehow make it all happen early enough so that it works with the code that is responsible for automatically putting your site in maintenance mode before the updates and taking it out of maintenance mode afterwards.

The code for (c) is in these functions (see what it does with $_SESSION['maintenance_mode']):
http://api.drupal.org/api/drupal/includes--update.inc/function/update_ba...
http://api.drupal.org/api/drupal/includes--update.inc/function/update_fi...

Sounds like fun :)

EvanDonovan’s picture

@David_Rothstein: Do you think this should be critical (rc blocker), since it affects the upgrade path? I guess probably not, since it could theoretically be documented as a "gotcha" and there is no data loss. The fact that there needs to be a beta-to-rc upgrade path too is a bummer.

Is this technically an API change due to the ugliness that it will cause in update_batch and update_finished?

Rather than writing an upgrade path for the variable could update_batch just check on variable_get('site_offline', FALSE) at the beginning as well?

David_Rothstein’s picture

@David_Rothstein: Do you think this should be critical (rc blocker), since it affects the upgrade path? I guess probably not, since it could theoretically be documented as a "gotcha" and there is no data loss.

Exactly. This is bad, but it doesn't prevent the update from actually working, or leave your site fundamentally broken afterwards. It shouldn't be a RC blocker, more in the "would be very useful to fix before release category", IMO.

jenyum’s picture

I agree, it really wasn't the biggest of hurdles. However, if it has been verified that it always happens it should be documented in the upgrade documentation until it is fixed.

dalin’s picture

Status: Active » Needs review
StatusFileSize
new854 bytes

Easier to just fix the bug rather than creating temporary documentation.

David_Rothstein’s picture

Worth testing, but I'm not sure I see how that fixes the bug... hasn't the session variable (and therefore 'maintenance_mode' itself) already been set by the time this runs?

dalin’s picture

StatusFileSize
new2.05 KB

Ah, I see. Here's another shot. I manually tested upgrading a D6 site and the site remained offline when I was done.

David_Rothstein’s picture

Hm, that little trick looks at first glance like it might work.... interesting.

Probably the variable_del() should happen inside a new update function, though (like in the earlier patch). If a site updated from Drupal 6 to Drupal 7 RC1 and is now updating again after this patch has been committed, we still want to clear the old variable for them.

dalin’s picture

StatusFileSize
new2.15 KB

Ah that makes sense. Here we go.

jhodgdon’s picture

The orginal report on this issue also says

Also ended up logged out, so had to set update.php access to TRUE.

Is this happening in your tests too? If so, can it be fixed in this patch too?

If it can't be fixed, we should also fix the UPGRADE.txt documentation to explain that this is going to happen (I'm not sure at what point in the upgrade process it happens either). We have information in there about how to set the update.php access to TRUE, but it's implied that it's a special case.

David_Rothstein’s picture

That part is a duplicate of #945112: Unable to stay logged in during upgrade from D6 -> D7 - and @dalin has a patch there too :)

The patch in #12 looks good to me. I haven't tested it so I don't want to mark it RTBC just yet, but will try to test later. One minor issue is that the code comment is wrong - it refers to 'system_update_7089' but it actually should be 'system_update_7069'.

jhodgdon’s picture

Excellent, thanks.

jpw1116’s picture

Version: 7.x-dev » 7.0-rc1

I noticed a related “feature,” new to 7.0-rc1:

In the past, within every D7 alpha and beta release, I was able to remain in forced Maintenance Mode after updating a module, e.g., Views.

Now I receive this:

Status message
Update was completed successfully. Your site has been taken out of maintenance mode.

Formerly, the Maintenance Mode state remained the same—namely, offline. The new way may be more logical but is a problem otherwise.

jhodgdon’s picture

Version: 7.0-rc1 » 7.x-dev

That's not a related "feature", it's this bug exactly. The above patch should fix it. Have you tested the patch, or would you be willing to?

dalin’s picture

StatusFileSize
new2.15 KB

Good catch David. I fixed the typo.

jpw1116’s picture

Thank you for clarifying, Jennifer. I have never even had 6.x, so I was hesitant to brand my 7.0-rc1 module updating as the same animal.

I haven't had a chance to test out any fix but plan to within 24 hours.

dalin’s picture

If you've never had 6.x then your issue is unrelated.

David_Rothstein’s picture

I did some final thinking about this patch in the following scenarios (and physically tested #1 and #3), and it all seems to work.

  1. Upgrading from D6, the new 'maintenance_mode' variable gets turned on if the old 'site_offline' was, and this all happens before the batch update starts, so the automatic turning on/off also works. Then 'site_offline' is deleted during the upgrade. All good.
  2. Running this on a site that previously did a fresh D7 install, there never was a 'site_offline' variable so this is a no-op.
  3. Running this on a D7 site that was previously updated from D6, the update_fix_d7_requirements() part of the patch gets skipped (not visible in the patch file, but this all runs within a drupal_get_installed_schema_version('system') < 7000 check, which is why). So all that happens is that the obsolete variable gets deleted, which is what we want.

I therefore think this is RTBC but it sounds like there may be another person or two who wanted to test this which is good; we can hopefully mark it RTBC soon.

I rerolled to fix another minor issue (the PHPDoc for the update function referred to the wrong variable name).

David_Rothstein’s picture

StatusFileSize
new2.14 KB

Er, and here is the reroll...

David_Rothstein’s picture

Related but minor issue I found while testing this: #987930: The obsolete 'site_offline_message' variable is not always deleted during the D6->D7 upgrade. (The patch will probably conflict with this one, so I didn't write one yet, but it's simple.)

@jpw1116, it sounds like the issue you're seeing might actually be this one: #976328: Update manager should not take you out of maintenance mode unless you asked it to

jpw1116’s picture

I wondered about that, David. You're right. Only I was attempting merely to update a module, not install one.

What is the next step in escalating the issue so that upgrading, installing and updating all get covered in the next release?

-John

jhodgdon’s picture

jpw1116: If you want to make sure that this patch gets added to Drupal before the release, the most helpful thing would probably be to test it, and report back with (a) what you did to test it and (b) what the results were.

You might also go to #976328: Update manager should not take you out of maintenance mode unless you asked it to and comment there with more details, if you think the issue you were seeing more resembles that one.

David_Rothstein’s picture

Status: Needs review » Reviewed & tested by the community

I think I'll mark this RTBC. (As described in #21, I reviewed it and tested it relatively thoroughly.)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Wow, that's quite the belly-dancing. :) Luckily it's all included in update_fix_d7_requirements() which will be the very first thing to be blown away in D8.

I looked at this awhile for a way it could bust D6 sites that hit update.php and then decide to get cold feet and not execute the update, but it seems sound.

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -D7 upgrade path

Automatically closed -- issue fixed for 2 weeks with no activity.