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.
Currently, there are a couple update hooks in core that begin to migrate Drupal 7 contrib Views data to Drupal 8 Views. Core should not be providing a contrib upgrade path.
Instead, D7->D8 migrations of Views data should be done with the views_d8_upgrade module. This migration tool will be developed later in the release cycle.
We are fine to just delete the incorrect update hooks now since we aren't rolling unstables yet.
Comment | File | Size | Author |
---|---|---|---|
#27 | views-1850418-27.patch | 1.98 KB | xjm |
#20 | views-1850418-19.patch | 2.03 KB | xjm |
#18 | views-1850418-18.patch | 507 bytes | xjm |
#17 | views-1850418-16.patch | 1.99 KB | xjm |
#16 | views-1850418-15.patch | 0 bytes | xjm |
Comments
Comment #1
xjmThis also blocks #1806334: Replace the node listing at /node with a view, because they were written such that the update hooks assume the D7 tables exist, and so the upgrade path chokes when enabling Views. At a minimum, we'd need to check
db_table_exists()
, but removing the misplaced upgrade path entirely is preferable.Comment #2
xjmThis issue also made me realize that we should not drop the
{variable}
table from old installations, even after we removevariable_set()
and so forth, because contrib will need to update its variables too.Comment #3
chx CreditAttribution: chx commentedYummy! Less the upgrade code, less to worry about...
Comment #4
sunCan we move this back up? — usually comes after
hook_schema()
, but before individual update functions.update_module_enable()
implements ahook_schema_0()
facility for basically the same... although it lacks thedb_table_exists()
condition. Perhaps it would make sense to inject that logic through an optional flag intoupdate_module_enable()
?Comment #5
xjmHm? This code is covering the case where
update_module_enable()
does not get called because contrib Views was already enabled on the D7 site.Attached just moves the
hook_last_removed()
back up; that was an accident.Also, forgot to mention -- chx had also suggested re-setting the module weight per the
hook_install()
sincehook_install()
won't be invoked for those sites, but I checked and Views 7.x-3.x had the same install weight, and we should avoid changing the weight on existing sites if possible since the user may have overridden it for compatibility with something else.Comment #6
xjmWhoops.
Comment #7
xjmcatch pointed out that this needs to be defined with a fixed schema (rather than
system_schema()
, which may change) since it's used in an update hook.Comment #8
xjmWith fewer syntax errors.
Comment #10
xjmSo @dawehner and I talked a bit about our strategy for http://drupal.org/project/views_d8_upgrade today. We're going to have a 7.x version of that module as well as an 8.x version, and have the 7.x version copy the user's Views data to some upgrade tables and then uninstall the module.
Comment #11
xjmDrupal\system\Tests\Entity\EntityTranslationTest->testMultilingualProperties()?
That looks random.#8: views-1850418-8.patch queued for re-testing.
Comment #12
xjmWhoops, didn't finish what I was saying. So if the helper module uninstalls D7 Views, then maybe we don't need any of this? And if they try to upgrade with Views installed... should we display a warning somehow?
Comment #13
sunThat plan sounds more reasonable to me.
We also did not provide any kind of upgrade path for all the field type modules that we've added to core for D8 — even though there are direct clashes with the field type names (and supplying an upgrade path for that in contrib will be quite a pain).
But yeah, that would at least be consistent, so +1 for removing this altogether.
Comment #14
xjmI can't actually test this patch yet because of #1848998: Problems with update_module_enable(), but something along these lines.
Comment #15
sunThat looks like the exact job of hook_update_last_removed() to me ;)
So we should just swap out the schema version, I think.
I'm not sure whether it makes sense to specify any removed version number though. As soon as the D7 contrib Views module will see a new module update, the logic will no longer work.
Hm. I'd prefer to leave this out entirely. As said, we did not introduce any special care for the new field type modules in D8, and we also did not do so for the entire CCK thing in D7.
--
All things combined, I think we should remove the
hook_update_last_removed()
, existing schema updates, and also don't introduce anyhook_requirements()
. All of this can be handled by the contrib migration module.Comment #16
xjmActually, let's split that off into its own issue since the bad update hooks are blockers for other issues. Filed #1851386: Add a hook_requirements() to Views disallowing unsupported upgrade from D7 Views.
Comment #17
xjmComment #18
xjmWell, trying to upgrade from D7 to D8 with Views installed is something we don't want to support, so I think it makes sense to simply inform the user and explicitly not support it. A lot of people will break their sites otherwise. (I'd also point out that the CCK upgrade issues caused many, many sites to languish on D6... including sites I maintain for work, even.) I don't think it does any harm to stop users from shooting themselves in the foot. We can do that in the other issue, though.
I guess it does make sense to take out the
_last_removed()
as well.Comment #20
xjmFor some reason I'm git-idiotic this evening; sorry for all the useless noise.
Comment #21
tim.plunkettNice diffstat ;)
After all of the conversation around this, I think this makes the most sense.
Comment #22
webchickWell then. :) Less code FTW, I guess. :)
At some point tonight I must've committed this because patch -p1 asks me if I meant -R. Woot. ;) Thanks!
Comment #23
sunBtw, is there any particular reason for why you plan to use a separate project instead of the views project directly for the D8 migration module?
Normally and technically, project != module. AFAIK, all tools that we have are able to properly differentiate between the two notions. IIRC, the CCK project was also continued for D7, but contained a content_upgrade.module or similar instead of the former module(s).
Comment #24
xjmBecause then there would be two different
views.module
in the user's codebase.Comment #25
tim.plunkettNot if we emptied out the 8.x branch to only have the upgrade path module...
Comment #26
xjmThis doesn't actually seem to be committed to 8.x yet.
Comment #27
xjmNo idea why this needs a reroll, but here it is.
Comment #28
webchickThere we go!
Committed and pushed to 8.x. Thanks!