Problem/Motivation

Just adding this as a placeholder to decide if we want to provide an upgrade path. And if we do, perhaps use this issue to start the work on it. Linking to #2906878: [Meta] Support for D7 -> D9 contrib migrate

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heddn created an issue. See original summary.

juampynr’s picture

Status: Active » Needs review
FileSize
8.95 KB

Here it is. This patch migrates module settings and patterns. I have seen some custom patterns that cannot be migrated automatically but this covers all of what comes with core such as content, users, and taxonomy patterns.

heddn’s picture

Status: Needs review » Needs work
+++ b/pathauto.module
@@ -177,3 +180,23 @@ function pathauto_pattern_validate($element, FormStateInterface $form_state) {
+function pathauto_migrate_prepare_row(

I would really like to see this move into a source plugin. Could we extend the variable source plugin and do it all in a single class? Instead of spread across two places?

jcnventura’s picture

Status: Needs work » Needs review
FileSize
5.25 KB
9.32 KB

@heddn I don't think this can be in a single class, since all the settings are config, but the patterns are entities.

In any case, regarding #3, it doesn't need to be in a source plugin, as it is simply a long list of variables going into a single config array. The new patch makes that without requiring a prepareRow() function.

heddn’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks for cleaning up the prepare row. This looks much more clean implementation.

This could at least use a unit test. See core/modules/color/tests/src/Kernel/Plugin/migrate/source/d7/ColorTest.php as an example to model.

jcnventura’s picture

Also, the migration yml files should be prefixed with d7_.

Even if the Drupal 6 migration is the same, the yml files should be cloned, as the current ones are tagged 'Drupal 7'.

jcnventura’s picture

Also, make this depend optionally on d7_node_type. If the pathauto migration is run before the d?_node_type, those paths depending on node type don't get imported.

jcnventura’s picture

FileSize
1.02 KB
9.4 KB

New patch, addressing my comments on #6 and #7.

juampynr’s picture

Status: Needs work » Needs review
FileSize
742 bytes
9.42 KB
109.91 KB

Here is a bug that I found while reviewing patterns. It was causing non-content patterns to contain invalid configuration.

DamienMcKenna’s picture

Tested this out on the Contrib Half Hour meeting this week and it worked as expected - the patterns were copied over from the D7 site and they worked as expected on new entities.

heddn’s picture

Status: Needs review » Needs work
Issue tags: +Novice

We could always use tests. But the basic code on here seems fine. No nits found. Actually just found 2. Bumping back to NW and tagging novice.

  1. +++ b/migrations/d7_pathauto_patterns.yml
    @@ -0,0 +1,23 @@
    +label: Pahauto patterns
    

    Label spelling.

  2. +++ b/migrations/d7_pathauto_settings.yml
    @@ -0,0 +1,95 @@
    +label: Pahauto configuration
    

    Label spelling.

slv_’s picture

Status: Needs work » Needs review
FileSize
632 bytes
9.42 KB

Re-rolled patch to fix the label spelling.

  • Berdir committed e293558 on 8.x-1.x authored by juampynr
    Issue #2953000 by jcnventura, juampynr, slv_, heddn, DamienMcKenna:...
Berdir’s picture

Title: Migrate configuration from Drupal 6/Drupal7 » Migrate configuration from Drupal7
Status: Needs review » Fixed

Thanks, looks like this has been sufficiently tested and reviewed, Tests would be nice, but I don't really see anyone going to do that.

I think this is just D7, so adjusting the title accordingly.

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

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