I am working on resolving some issues in a Drupal 7 to 8 migration. The Drupal 8 site was handed to me after the site migration had been run and much of the site configuration (e.g. views, blocks, etc.) added. None of the site configuration is in code. In order to troubleshoot/resolve the migration issues without losing the rest of the site configuration already in place, I was thinking of rolling back the migration and then re-migrating.

One thing I have noticed in most tutorials about Drupal 7 to 8 migration, is that they say you need to start with an empty site (The upgrade migration process generates the relevant Drupal 8 structures/configuration during the migration/upgrade process). Given that my site already has migrated content, all of the content types, etc. normally generated by the migration/upgrade process is already in place. Is it possible to run a standard Drupal 7 to Drupal 8 migration on a site with these existing content structures (e.g. content types, etc.) already in place or is it essential to start with an empty site as directed by most tutorials on the topic?

Comments

Begun created an issue. See original summary.

cilefen’s picture

quietone’s picture

Issue tags: +migrate-d7-d8

add tag.

BenStallings’s picture

Version: 8.3.5 » 8.6.1

Hi, Begun. I hope you haven't been waiting all this time for an answer! I just gave a presentation at a camp yesterday that may be applicable: https://tinyurl.com/drupalcorn-migrating and I'm now at a contrib day trying to help improve the documentation on this topic, which as you've seen is badly lacking.

In brief, you can use the functionality of drupal_migrate module without using its /upgrade feature that blows away your whole site. Each of the core modules comes with a migrations directory containing YML files that you can use as templates, and also a src/plugins/migrate directory containing plugin classes that you can extend or substitute with your own classes. You will have to write some code to make this happen, at the very least YML, but it's pretty straightforward compared to how we did it in Drupal 7.

For example... if you wanted to import just Blog nodes from your D7 site, you would copy the core/modules/node/migrations/d7_node.yml file to your ../config/sync/migrate_plus.migration.blog.yml and edit it to set id: blog, and just under the source plugin: d7_node specify node_type: blog. Under process, follow the instructions to remove the nid and vid fields. Then add in the fields you do want to import. Finally, remove the dependencies so that required: { } and optional: { }. Then import the configuration and try importing blogs!

Good luck!

BenStallings’s picture

Status: Active » Needs review

setting to Needs Review

maxocub’s picture

Status: Needs review » Active

Let's leave this on Active as there is no patch to review.

quietone’s picture

Status: Active » Postponed (maintainer needs more info)

@Begun, has this been resolved?

Is it possible to run a standard Drupal 7 to Drupal 8 migration on a site with these existing content structures (e.g. content types, etc.) already in place or is it essential to start with an empty site as directed by most tutorials on the topic?

If one upgrades from the UI at /upgrade the source IDs, for example nids, are not changed on the destination site. So, any new content on the destination that has the same nid as a node on the source will be over-written and the newly added content will be lost.

To migrate to a Drupal 8/Drupal 9 site that has existing content then some migration yml need to be modified. For example, take a look at th d6_node.yml file.

Version: 8.6.1 » 8.6.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

quietone’s picture

Is this issue still a problem?

There has been no activity here for 7 months.

Since we need more information to move forward with this issue, I am keeping the status at Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

benjifisher’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)