Problem/Motivation

Note that, as of 8.8.x, modules can declare their Drupal 8 (or 9) upgrade status (changelog, issue #2936365: Migrate UI - allow modules to declare the state of their migrations). Since there is no data to migrate from diff-7.x-2.x, diff-6.x-2.x, and diff-6.x-1.x, we should mark those migrations as "finished".

As a site owner migrating my site from Drupal 7 running diff-7.x-3.x to Drupal 8 or 9 running diff-8.x-1.x, I want to migrate configuration from diff, so that my Drupal 8/9 site has the same behavior as my Drupal 7 site.

It appears that 7.x-3.x stores the following data:

  1. Global variables:
    1. diff_context_lines_leading (integer >= 0) - migrations exist as of #5
    2. diff_context_lines_trailing (integer >= 0) - migrations exist as of #5
    3. diff_show_diff_inline_node_bundles (associative array) - done since there is no corresponding 8.x-1.x features/settings
    4. diff_radio_behavior (string) - migrations exist as of #5
    5. diff_theme (string) - done since there is no corresponding 8.x-1.x features/settings
  2. For node and user entities, the following variables:
    1. diff_additional_options_{$entityId} (associative array) - done since there is no corresponding 8.x-1.x features/settings
    2. diff_admin_path_{$entityId} (boolean) - done since there is no corresponding 8.x-1.x features/settings
    3. diff_default_state_{$entityId} (string/word) - done since there is no corresponding 8.x-1.x features/settings
    4. diff_show_header_{$entityId} (boolean) - done since there is no corresponding 8.x-1.x features/settings
  3. For file fields, a diff_file_field_file_default_options variable that contains the following data:
    1. show_header (boolean)
    2. show_id (boolean)
    3. compare_alt_field (boolean)
    4. compare_title_field (boolean)
    5. property_separator(string)
    6. markdown (string)
    7. line_counter (string)
  4. For image fields, a diff_file_field_file_default_options variable that contains the following data:
    1. show_header (boolean)
    2. show_id (boolean)
    3. compare_description_field (boolean)
    4. compare_display_field (boolean)
    5. property_separator(string)
    6. markdown (string)
    7. line_counter (string)
  5. For each list field type, a diff_list_field_{$fieldType}_default_options variable that contains the following data:
    1. show_header (boolean)
    2. compare (string)
    3. markdown (string)
    4. line_counter (string)
  6. For each text field type, a diff_text_field_{$fieldType}_default_options variable that contains the following data:
    1. show_header (boolean)
    2. compare_format (boolean)
    3. markdown (string)
    4. line_counter (string)
  7. For taxonomy [term reference] fields, a diff_taxonomy_field_taxonomy_term_reference_default_options variable that contains the following data:
    1. show_header (boolean)
    2. show_id (boolean)
    3. sort (string)
    4. markdown (string)
    5. line_counter (string)
  8. For each remaining field type, a diff_{$d7Module}_field_{$fieldType}_default_options variable that contains the following data:
    1. show_header
    2. markdown
    3. line_counter

Proposed resolution

Add migrations.

Declare the finished upgrade path from D6 by creating a migrations/state/diff.migrate_drupal.yml and populating it appropriately.

Remaining tasks

  1. Write a patch for global settings
  2. Decide whether we want to migrate field configurations
    1. If "yes", then update the patch to migrate field configurations
  3. Review and feedback
  4. RTBC and feedback
  5. Commit
  6. Release

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork diff-3199333

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mparker17 created an issue. See original summary.

miro_dietiker’s picture

Category: Bug report » Task

I didn't maintain the 7.x version, so i don't remember exactly the status there.

8.x is so much different that we felt like the default configuration is a healthy start and everything else that needs adjustments would be due to the different behavior and options 8.x provides. Where guessing from 7.x settings would provide little value.

I can be wrong, but that's why we didn't even consider providing a migration.
Is there any setting of value that should be migrated?

BTW i don't know if a migration is a task or a feature, but likely not a bug?

mparker17’s picture

Issue summary: View changes

Updated issue summary with a list of what we need to migrate

mparker17’s picture

Issue summary: View changes
StatusFileSize
new34.88 KB

As a bit of context, I'm trying to move a D7 site that I maintain in my spare time to D8/9 before D7 reaches end-of-life. The site uses 55 contrib modules that I want to keep around in D8/9; and 39 of those (i.e.: 71%) are missing migrations (although I've patched 9 of those already, leaving me with 30 to go)

I have been putting off upgrading from D7 because of the missing migrations (and I suspect other folks in the Drupal community have too).

To some extent, I'd like to know that the diff module's migration is "finished", i.e.: either because there is a migration, or because the maintainers consciously chose not to write a migrate. Right now, Drupal core's Migrate Drupal UI tells me the diff module "will not be upgraded", and until I filed this ticket, I wasn't sure whether the diff module not being migrated would be a bad thing.

A screenshot of the missing diff migration


BTW i don't know if a migration is a task or a feature, but likely not a bug?

In the case of the diff module, I hadn't really configured it much in D7; and the D9 site didn't appear to be broken, so I was considering it as a feature request.

8.x is so much different that we felt like the default configuration is a healthy start and everything else that needs adjustments would be due to the different behavior and options 8.x provides. [...] that's why we didn't even consider providing a migration.

That's fair enough... and again, we could just mark the migration as "finished" in migrations/state/diff.migrate_drupal.yml to indicate "the maintainers familiar with both versions don't think there's anything that needs to be migrated"... for my particular use case, that would be fine; although I dunno if I'm a typical use case.


If we do decide to write migrations, comparing the 7.x-3.x variables with the 8.x-1.x configuration...

  1. the node/user variables don't have a corresponding feature in D8, so those are "done" because there's nothing to migrate
  2. likewise, several pieces of global configuration easily map from D7 to D8; that seems pretty feasible/easy
  3. what I'm worried about is the per-field-type migrations... offhand the part that looks tricky is trying to figure out which D8 module, field type, and diff plugin maps to which D7 module and field type (once that's sorted, hopefully migrating the field settings would be feasible)

... perhaps the best approach here is a hybrid one, i.e.: migrate the easy global configuration, and mark the migration as finished; and if someone files an issue because they really need the per-field-type migrations, we can deal with that one when it comes up.

@miro_dietiker, what do you think?

mparker17’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new8.42 KB

Here's a patch to migrate the global configuration, but NOT the field configurations. Note it assumes the missing field config is intentional and marks the migration as complete; but includes a comment to reference this issue.

Marking as "Needs review" so testbot runs; and to get an answer for #4; but feel free to set it back to "Needs work" if we decide we do want to migrate the field configurations.

mparker17’s picture

StatusFileSize
new8.41 KB
new534 bytes

Apparently drupal.org's testbot wants public static $modules in tests; while my local run-tests.sh wants protected static $modules

mparker17’s picture

I am happy to report that I was able to use this patch to successfully migrate my Diff module configuration from my drupal-7.99 site running diff-7.x-3.4 to a drupal-10.2.1 site running diff-8.x-1.1.

I cannot RTBC this issue because I wrote the patch. But, hopefully, my success will help other people migrating D7 to D10.

However, now that my D7 to D10 site migration is complete, my ability to contribute further to this issue is severely limited, because the D7 site that I had been using to test has been retired. However, I'll keep an eye on this issue and try to answer questions to the best of my ability.

heddn’s picture

Version: 8.x-1.x-dev » 2.x-dev

Can we convert this to an MR at this point?

mparker17’s picture

I've tried, but as mentioned in #7, my D7 to D10 site migration is complete and my D7 site retired, so I have no way to manually test that it still worked the way it did 10 months ago (but note the MR contains automated tests).

heddn’s picture

Status: Needs review » Reviewed & tested by the community

The items being migrated are reasonable and checks just another box on the upgrade from D7. I made some very minor phpcs and test fixes. So let's just RTBC this thing.

  • heddn committed ba46d1ac on 2.x authored by mparker17
    Issue #3199333 by mparker17, heddn: Migrate configuration from 7.x-3.x
    
heddn’s picture

Status: Reviewed & tested by the community » Fixed
mparker17’s picture

Awesome, thanks @heddn!

Status: Fixed » Closed (fixed)

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