Problem/Motivation

Created a list of Configuration migrations to run using 'drush migrate:template:list --tag=Configuration' and edited out the drupal 6 configuration. Then ran that using drush mm using a Drupal 7 source. I was surprised to see 'd7_user' being run. d7_user is definitely Content. Yet there is was.

So, grepped for migrations with d7_user and Configuration and found 6 migrations, 5 which are valid say, d7_user_role, which is configuration. That left d7_shortcut_set_users, which is tagged Configuration since it is a config entity but is dependent on d7_user which is Content.

That means that when one gets a list of Configuration migrations to run you also have to check the dependencies to see what will actually run. That is certainly extra work. I don't know if other Configuration migrations are dependent on Content migration as it is still running. And I don't see a way around this since ShortcutSet is a config entity. Well, it could be move to Content since it is dependent on content. I don't know. At least document this behavior. Note the original issue did not add documentation #2711099: Categorize migrations according to their type

Marking as Task since this seems more likely to be covered in documentation.

id: d7_shortcut_set_users
label: Shortcut set user mapping
migration_tags:
  - Drupal 7
  - Configuration
source:
  plugin: d7_shortcut_set_users
process:
  uid:
    -
      plugin: migration_lookup
      migration: d7_user
      source: uid
    -
      plugin: skip_on_empty
      method: row
  set_name:
    plugin: migration_lookup
    migration: d7_shortcut_set
    source: set_name
destination:
  plugin: shortcut_set_users
migration_dependencies:
  required:
    - d7_shortcut_set
    - d7_user

Proposed resolution

A) Tag Configuration migrations as Content if they depend on Content
B) Document the yml where this occurs and maybe on d.o where ever the Content/Configuration tags are explained

This occurs in 3 configuration migrations

  • d6_block.yml
  • d7_block.yml
  • d7_shortcut_set_users.yml

Remaining tasks

Patch
review
commit

CommentFileSizeAuthor
#11 3014629-11.patch1.29 KBquietone

Comments

quietone created an issue. See original summary.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

xjm’s picture

wim leers’s picture

Issue tags: +migrate-d7-d8
wim leers’s picture

wim leers’s picture

Linked here from #2711099-107: Categorize migrations according to their type since this is technically a follow-up to that. Also updated the change record at https://www.drupal.org/node/2944527 to point to this issue too, since it's crucial information that may otherwise lead to significant lost time and confusion.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +migrate-d6-d8
StatusFileSize
new1.29 KB

No running tests because this is only documentation.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

xurizaemon’s picture

Status: Needs review » Reviewed & tested by the community

LGTM @quietone, and thanks - I learned a thing here :)

quietone’s picture

@xurizaemon, thanks for the RTBC!

I've started the tests.

mikelutz’s picture

I confess, I don’t completely understand the need here. The dependencies for the migrations are already self documented in the yml. I didn’t realize that some people had an expectation when we tagged the migrations as config or content that there wouldn’t be any config migrations that were dependent on content, and I think that underlying assumption is just flawed.

There’s always been config that depends on content in Drupal, with the block system being the obvious one in core, but I think there are more examples in contrib, though I confess I can’t think of one off the top of my head. Yes, most of the time, configs aren’t dependent on content, but it’s never been a hard and fast rule. I don’t oppose to adding the note here, but I wonder if we shouldn’t do more. We should make sure anywhere we have documentation on the content and config migrations that we point out that there is nothing that prevents config migrations from depending on content migrations either in core or contrib if this misunderstanding is prevalent.

quietone’s picture

@mikelutz, this came about because of #2826742: Expose migration types in Migrate UI where the goal is to be able to run only configuration or only content migrations from the UI. I was unaware of that content depended on config so it surprised me and thought it is worth documenting in the migrations.

I do agree that adding more documentation is a good idea. I'd rather see a new issue that addresses the situation for all of core. I don't have a recommendation as to where to put such documentation.

  • catch committed b73cc1c on 10.0.x
    Issue #3014629 by quietone, Wim Leers, xurizaemon: Document that...
catch’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Agree with @mikelutz here except if you hadn't realised this, I think it could be very confusing. So let's add the specific docs here and then figure out somewhere more generic to put a general note in a follow-up.

  • catch committed 8e79d48 on 9.4.x
    Issue #3014629 by quietone, Wim Leers, xurizaemon: Document that...

  • catch committed 66130f6 on 9.3.x
    Issue #3014629 by quietone, Wim Leers, xurizaemon: Document that...

Status: Fixed » Closed (fixed)

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