Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
During the 6.x release cycle, we removed all 4.7-5.x updates to enforce the one major version upgrade at a time guideline more strictly, reduce memory usage on update.php, etc.
Here's a patch which does that, and also a bit of tidying in .install files - adding update phpdoc if it's missing, getting hooks in the same order etc.
Comment | File | Size | Author |
---|---|---|---|
#58 | 278592_extra_updates.patch | 6.65 KB | andypost |
#51 | 278592_system_extra.patch | 3.26 KB | andypost |
#37 | extras.patch | 2.21 KB | catch |
#32 | 278592_followup.patch | 486 bytes | tobiasb |
#22 | drupal-updates.all_.patch | 102.11 KB | sun |
Comments
Comment #1
webernet CreditAttribution: webernet commentedThere are a couple blocks of code in update.php for the 5.x-6.x update as well.
Comment #2
catchWell spotted, new patch.
Comment #3
webernet CreditAttribution: webernet commentedLooks like there's (at least) one more...
Comment #4
catchGot that one. Did a grep, found some in blogapi.install - this should be everything now.
Hopefully this is all of them. Thanks for keeping your eyes peeled webernet.
Comment #5
lilou CreditAttribution: lilou commentedPatch #4 re-rolled against CVS HEAD.
Comment #6
catchtesting the testing bot
Comment #7
catchand again.
Comment #8
pwolanin CreditAttribution: pwolanin commentedthis is a good idea, but we should make 6.x->7.x updates work at all so we can confirm this patch.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #10
Dave ReidThe previous patches were missing adding implementations of hook_update_last_removed and a few @defgroup 7.x blocks. I also wanted to make sure that update functions were always at the bottom of the .install file. That's why there are big changes in comment.install in this patch. No updates are actually changed however. I also found a few 700x updates that didn't start with 7000, so I fixed those as well.
Comment #12
Dave ReidRerolled since the user table name was rolled back to users.
Comment #14
catchSlight memory savings without APC enabled:
/admin (yes, we load every install file on /admin).
Before:
Memory used at: devel_boot()=2.59 MB, devel_shutdown()=22.67 MB, PHP peak usage=23 MB.
After:
Memory used at: devel_boot()=2.62 MB, devel_shutdown()=22.02 MB, PHP peak usage=22.25 MB.
Note there's absolutely no way these updates will run when the dbtng backwards compatibility layer is removed - so unless someone goes back retrospectively to both convert to dbtng and check for API functions which use one of the many renamed tables in D7 those updates are going to blow up for anyone trying a direct 5-7 upgrade.
Comment #15
Dries CreditAttribution: Dries commentedYep, we should remove those and force people to upgrade from Drupal 5 to Drupal 6 first. It is the recommended practice anyway. Marking RTBC so people can chime in if they still want to.
Comment #16
webchickThe "but won't someone think of the users?!?!?" part of me wants us to retain the upgrade path, since there are probably lots of sites out there that want to make the jump directly from 5.x to 7.x. But the technical arguments for removing this code are pretty compelling. So I've no problems with this patch being committed. I can do so tomorrow if you don't beat me to it. :)
Comment #17
catchUsers can still drop in a Drupal 6 code base, run update.php, then drop in a Drupal 7 install and run update.php in that - which will allow them to run their contrib module updates at the same time (which may or may not leave an upgrade path between Drupal versions - CCK from 5.x-7.x?).
Comment #18
chx CreditAttribution: chx commentedRight. NowPublic plans a D5->D7 upgrade but this does not mean I need to upgrade code in there
Comment #19
Dries CreditAttribution: Dries commentedI'm not sure I understood what you said in #18, chx. Are you OK with committing this patch?
Comment #20
sunAn alternative would be to move all updates into $module.updates.inc - as a new standard. Solves the "$module.install is loaded on admin pages" and related issues.
FWIW, I also plan to upgrade most of our sites from D5->D7.
Comment #21
catch@sun I think we should do that as well. But that won't solve update.php memory issues or the poor sod who has to go back and try to make Drupal 5-6 updates work for Drupal 7 (and in contrib too).
Comment #22
sunFWIW.
Comment #23
catchNice. Opened #497408: Move hook_update_N() to module.update since it makes a lot of sense to do that regardless.
Comment #24
Dries CreditAttribution: Dries commentedBefore something like #22 gets committed I want to study why we load all the install files. Can't look at the code yet.
Comment #25
catchhttp://api.drupal.org/api/function/system_status/7
Comment #26
sunIIRC, reason is hook_requirements(), which is supposed to live in $module.install. Some paths on/below admin/* check whether all requirements are met, and output a warning if not.
Comment #27
sunok, http://api.drupal.org/api/function/system_requirements/7 checks whether the database schema of all modules is up to date and thereby loads all hook_update_N() implementations via http://api.drupal.org/api/function/drupal_get_schema_versions/7. umph.
Comment #28
yched CreditAttribution: yched commentedFWIW, there's very little chance that CCK -> Fields D7 upgrade will work from anything else than D6.
+ When work on this progresses, it might very possibly uncover the need for a 'preparation' on the D6 side (before core upgrade), thus requiring getting current with CCK D6 latest release before upgrading core (just like a D5->D6 upgrade requires you get current with CCK D5 first)
Comment #29
catchLooks like the unconditional load of every install file in system_status() is a pre-registry hangover. But since system_requirements() itself is going to load all updates (and is in system.install - by far the worst culprit anyway), then the only way to get the memory/code weight saving is to remove unneeded ones.
Comment #30
Dries CreditAttribution: Dries commentedI was going to investigate this this morning, but you guys beat me to it when I was sleeping. Awesome. The Drupal community never sleeps. :-)
I'll go ahead and commit the patch in #14 and then we can continue to worry about loading of all the files in #497408: Move hook_update_N() to module.update?
Comment #31
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #32
tobiasbFatal error: Call to undefined function update_fix_d6_requirements() ...update.php on line 711
Comment #33
catchOuch.
Comment #34
Dries CreditAttribution: Dries commentedOops. Committed to CVS HEAD. Thanks.
Comment #36
Gábor HojtsyLooks like this patch removed a few update functions which were not actually 5.x to 6.x updates. Around the first part of the patch is blogapi_update_6001(), which explicitly has in its comments that it is a 6.4 update. A locale location column update has a similar fate (realized via http://drupal.org/node/221020#comment-2038462). Granted these were not properly marked with the "updates-6.x-extra" group, which marks updates added after 6.0 was released. What's worse though is that updates explicitly marked with updates-6.x-extra were removed in system.install the same time.
We SHOULD keep the updates-6.x-extra updates in core, since that is the only way for 7.x to support upgrading from any 6.x version (which is our tradition and intention as far as I'm informed). If we remove updates which were added in the 6.x cycle, we'd require people to update to the latest 6.x first and only then update to 7.x. That is not how we operated so far.
My suggestion to revise this patch is to try and apply it to a Drupal 6.0 checkout. Whatever does not apply there was added after 6.x and should be rolled back and marked with the updates-6.x-extra tag. The locale location column update function was added with the wrong number even, so that should be resolved in its own issue, please leave the rollback of that out here.
Note that the patch Dries committed is in #14.
Comment #37
catchI'm not clear what the status is with that locale patch or what needs to avoid being rolled back here, so just included it - easy to delete that hunk from the patch to move it to another issue.
Blogapi is left out - that needs to be in the contrib blogapi module for D7 if anyone ever makes one.
System now has it's extras group back.
Comment #38
Gábor HojtsyDid you run through the other update functions on a check whether any others were inadvertently removed? I've just included the above as examples and suggested a procedure to verify the others.
Comment #39
catchNo I didn't.
Comment #40
Gábor HojtsyOk, let's ensure we did not restore only the random items I found manually but we systematically ensure that all update functions added after 6.0 are restored.
Comment #41
catchWell that means this patch needs review, to see if we lost any more than what's included, if we find any missing, then it needs work.
Comment #42
Gábor Hojtsy@catch said in IRC, that he thinks that we should not support updates from any 6.x version to any 7.x version. Our whole development methodology is geared towards producing code supporting that though. Issues are expected to be filed against 7.x first and resolved there first before bumped back to 6.x. So by the time a possible DB update ends up in the D6 queue, it is already in D7. That is, all DB updates added after Drupal 6.0 should be in D7. Therefore Drupal 7 should support updating from any Drupal 6.x version. Changing development approaches at this point in the D7 development would not be a good idea IMHO.
Therefore we should ensure we have all extra updates restored.
Comment #43
catchTo clarify, I don't think this patch should've removed the 6.x-extra defgroup, and that wasn't in the initial patch on here - looks like it crept in during one of the re-rolls.
However, in principle, I think we should support updates of any release of 6.x after 7.x is released - since at that point both releases are supported. However, I don't think we particularly need to support updates from 6.0 to 7.0 since you really shouldn't be running 6.0 in February 2010 or whenever 7 comes out, and if you are, then the extra step of going to 6.0 to 6.latest-stable probably isn't the worst of your troubles. If we had such a policy, that'd mean we'd only add the -extra defgroup for schema changes to 6.x after the initial 7.0 release is out - which isn't going to happen often, since all backported updates would only appear once.
fwiw there's been a lot of moving around of update hunks in HEAD in cleanups so just checking what fails to apply is unlikely to give useful output, the more likely method to find missing updates is to check cvs history in 6.x .install files.
Comment #44
andypostSo what is the preferable way to make updates in install files before D7 released?
Mostly about #107824: Convert {watchdog}.referer and {accesslog}.url from VARCHAR to TEXT
and same #221020: locales_source.location is just varchar(255) and it is not truncated
if we already make a change in D6 schema in 6-extra section do we need a 700X update function?
Comment #45
Gábor HojtsyThe way we did it with 5.x to 6.x is that we built in checks into the 6.x update functions to skip their business if the relevant 5.x update already happened. For identical updates, I think we've also left in "no-op update functions" (named empty functions) to signal that the given update number was removed due to a previous update covering the same thing.
Comment #46
Dave ReidWe need to re-add the 6.x-extra updates to our D7 system_install since we have broken update paths. Everything from system_update_6048() on up needs to be re-added, and system_update_last_removed() should be 6047.
Comment #47
Dave ReidLatest patch is missing update_6050 through 6053.
Comment #48
Dave ReidMoving to a bug report so we don't miss this before release.
Comment #49
andypostLet's summarize here issues that have broken upgrade path or should be changed.
Maybe there's an issue about reworking|reordering update_N() functions in D7, so please point to it if any.
#107824: Convert {watchdog}.referer and {accesslog}.url from VARCHAR to TEXT
#334283: Add msgctxt-type context to t()
#221020: locales_source.location is just varchar(255) and it is not truncated
#215080: Performance: change {system}.type: alter table system modify column type VARCHAR(32);
Comment #50
ctmattice1 CreditAttribution: ctmattice1 commentedWhile playing with update I ran across two items. First is the system tables default values in 6.14 do not match 7.x, in particular the weight field in 6.14 is set to tinyint(2) but in 7.x is int(11). This causes failure in update.inc function update_fix_d7_install_profile() Cannot upgrade from Drupal 6 to Drupal 7 - meta issue.
The other issue I ran into was the role_permissions tables and registry tables need to be created before updating. found role_permissions in system_update_7007. What I did was to change the system tables defaults and create the registry files in update.inc, had to also change the system_update_functions to check for the existence of the schema and skip table creation before running on both.
setting it up in update.inc still allows installs as expected and 6.x - > 7.x update with errors.
I don't pretend to know what else I missed. The errors I had dealt with d6 modules and filetimec errors on paths which resembled old d6 modules I hadn't disables when I tried the update. I particular it caught the cck module.
Can provide a diff if anyone is interested.
Comment #51
andypostThis patch sync drupal-6 extra system updates section with drupal-7
Comment #52
catch#51 is missing the locale update from #37.
Comment #53
andypost@catch locale still waiting for review in D6 #221020: locales_source.location is just varchar(255) and it is not truncated
Comment #54
catchOK that's good enough for me.
Let's get this in.
But leave it open and at the same status so we can scour for more like the locale one which is still in flux.
Comment #55
catchRe-titling.
Comment #56
andyposttaggin
Comment #57
andypostThis is a split for all modules with extra updates in d6
- modules/dblog/dblog.install
- modules/locale/locale.install
- modules/statistics/statistics.install
- modules/system/system.install - this one
Both #107824: Convert {watchdog}.referer and {accesslog}.url from VARCHAR to TEXT and #221020: locales_source.location is just varchar(255) and it is not truncated
I mark as postponed till this commited
Comment #58
andypostpatch
Comment #59
catchThis covers everything I'm aware of now - if, like me, you're wondering about the locale_update_7000() hunk when you read this, that's because we committed a 6.x update function to 7.x, which was never backported to D6, which then got removed by the original patch here or a similar one. Fun.
Comment #60
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #61
catchLeaving this active until we're 100% sure we got everything.
Comment #62
moshe weitzman CreditAttribution: moshe weitzman commentedcan we remove the critical or close this?
Comment #63
nimi CreditAttribution: nimi commentedI am having the mentioned watchdog problem of "data too long for column..." on my multilingual site.
Is the patch attached on comment #58 the one I need to apply to fix this?
One more thing, usually the patches I've seen apply changes to ".module files". This one, however, targets the ".install" files.
This means that I need to apply it normally and then run update.php?
Am I on the right track here?
Thanks,
Nimi.
Comment #64
nimi CreditAttribution: nimi commentedanyone? help please...
Comment #65
gpk CreditAttribution: gpk commented@64: suggest you open a support request or forum topic - this issue is specifically about changes needed in 7.x. Without more info (Drupal version, exact error message) it's not possible in any case to answer your questions...
Comment #66
andypostSuppose this issue should stay critical until D7 is released because D6 still have issues
system_update_7025()
is broken as reported at #77 #358315: drupal_lookup_path() not respects alias' orderLet's wait for commit to D-6 branch... then sync new
system_update_6054()
Another old issue #39 #221020: locales_source.location is just varchar(255) and it is not truncated waiting...
Comment #68
sun.core CreditAttribution: sun.core commentedSince those are covered by other issues already, no need to keep this one open + critical.