Problem/Motivation

Migration D7 to D9.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork m4032404-3253529

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

omkar.podey created an issue. See original summary.

omkar.podey’s picture

StatusFileSize
new5.9 KB

Initial patch.

huzooka’s picture

About the failing tests:

  1. PHP 7 & MySQL 5.5, D8.9.20 run-tests.sh fatal error - core 8.whatever cannot be tested anymore on Drupal CI
  2. PHP 7 & MySQL 5.5, D9.2.9 Composer error. Unable to continue. - core 9.0+ requires at least PHP 7.3
  3. PHP 8.0 & MySQL 5.7, D9.2 4 pass, 2 fail and PHP 7.4 & MySQL 5.7, D9.2 4 pass, 2 fail: in Drupal 9, the $defaultTheme property must be set in functional tests if you're not testing with an install profile

Functional tests should be updated according to https://www.drupal.org/node/3083055.
And the automated test enviroments PHP 7 & MySQL 5.5, D8.9.20 and PHP 7 & MySQL 5.5, D9.2.9 schould be removed or changed accordingly.

huzooka’s picture

+++ b/tests/src/Kernel/M4032404MigrationTest.php
@@ -0,0 +1,46 @@
+  /**
+   * Asserts that m4032404 configuration is migrated.
+   */
+  public function testMailSystemMigration() {
+    $expected_config = [
+      'admin_only' => TRUE,
+    ];
+    $this->executeMigration('d7_m4032404_migrate');
+    $config = $this->config('m4032404.settings')->getRawData();
+    $this->assertSame($expected_config, $config);
+
+  }

It would be nice to check what is the original configuration (I guess it will be totally empty), and I would delete the last empty line from the method, but this is all I can raise.

Maybe we can add a migrate_drupal status file.

A simple, but perfect migration patch, with test coverage!

omkar.podey’s picture

StatusFileSize
new6.28 KB
new1.04 KB

Fixed tests and added migrate_drupal status file.

omkar.podey’s picture

Status: Active » Needs review
wim leers’s picture

Queued test against Drupal 9.2 and PHP 7.4.

wim leers’s picture

Title: Migration D7 to D9. » Migration from D7 to D9
Status: Needs review » Reviewed & tested by the community
  1. +++ b/migrations/d7_m4032404_migrate.yml
    @@ -0,0 +1,14 @@
    +source:
    +  plugin: variable
    +  variables:
    +    - m4032404_admin_only
    +process:
    +  admin_only: m4032404_admin_only
    

    Per https://git.drupalcode.org/project/m4032404/-/blob/8.x-1.x/config/schema... + https://git.drupalcode.org/project/m4032404/-/blob/8.x-1.x/config/instal..., this really is the only configuration. 👍

  2. +++ b/tests/src/Kernel/M4032404MigrationTest.php
    @@ -0,0 +1,47 @@
    +    $this->assertSame([], $config_before);
    +    $this->executeMigration('d7_m4032404_migrate');
    +    $config_after = $this->config('m4032404.settings')->getRawData();
    +    $this->assertSame($expected_config, $config_after);
    

    Perfect test — this gives us 100% confidence the migration is working as intended 👍


The test seems to fail, but the newly added migration test is working:

00:03:01.325 Test summary
00:03:01.325 ------------
00:03:01.325 
00:03:01.965 Drupal\Tests\m4032404\Unit\EventSubscriber\M4032404EventSubs   3 passes                                      
00:03:01.965 Drupal\Tests\m4032404\Kernel\M4032404MigrationTest             1 passes                                      
00:03:02.824 Drupal\Tests\m4032404\Functional\M4032404TestCaseTest          0 passes             1 exceptions             
00:03:04.265 FATAL Drupal\Tests\m4032404\Functional\M4032404TestCaseTest: test runner returned a non-zero error code (2).
00:03:04.331 Drupal\Tests\m4032404\Functional\M4032404TestCaseTest          0 passes   1 fails                            
00:03:04.331 
00:03:04.376 Test run duration: 3 sec

elc made their first commit to this issue’s fork.

elc’s picture

Assigned: omkar.podey » Unassigned
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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