2

I am preparing to do a Drupal 7 to Drupal 8 migration. This is not a pure like for like migration. Whilst many of the content types are similar there will be some differences between the Drupal 7 and Drupal 8 content types and paragraphs (i.e. site architecture improvements).

I would have thought that the easiest way to do the migration would be to completely rebuild the site in Drupal 8 and configure and customise it the way I want and then just migrate the content (e.g. users, taxonomy, nodes, etc.); however, according to the Drupal documentation one should not configure the site. From the Drupal "Preparing a site for upgrade to Drupal 8" page

Do not configure the Drupal 8 site

Keep in mind that the upgrade process will overwrite configuration on the Drupal 8 site, so do not do any configuration of the Drupal 8 site until after the upgrade process is complete. This means you do not have to create all the content types and fields manually before running this upgrade. The Migrate module will create them as a part of the migration process. In fact, it is a common best practice to install Drupal 8 using the Minimal install profile, because the Standard profile introduces its own configuration that you might not want to use.

Couldn't I just build and configure the Drupal 8 site just the way I like it and then just migrate the content being sure to customise the migration in order to adjust for any architectural changes? This idea of migrating all content and configuration and then making content changes afterwards doesn't make sense to me.

1
  • 1
    Yeah build your now D8 site and then maybe write your own batch process to migrate the content the way you want.
    – leymannx
    Jul 19 '20 at 6:24
1

TL;DR: use Migrate and associated modules to do the heavy lifting, adding in your own code as needed.

Yes, you absolutely can build your configuration first and then migrate content. I'd suggest the following outline approach (you'll still need to read the documentation for Migrate and these modules carefully):

  1. Install the Migrate Tools and Migrate Upgrade modules.
  2. Use migrate upgrade to generate prototype migration configuration, eg. drush migrate-upgrade --legacy-db-url=mysql://user:pass@12.34.56.78/d6db --legacy-root=http://myd6site.com --configure-only
  3. Export the configuration and weed out any migrations that you don't need, such as content type and field definitions. Remove references to these from other migrations.
  4. Edit the remaining configurations to your needs. This can be laborious and for some cases it may be easier to use custom hooks to manipulate data rather than configuring process plugins. However, the process plugins provided by core, supplemented by those from Migrate Plus, are very powerful once you understand them.

These modules will do much of the hard work for you so you can concentrate on the tougher problems you may face, such as dealing with embedded media tags that may require modules that are not ported to D8.

(If you are thinking of moving field collections to paragraphs, the D8 Paragraphs module has everything you need already in place).

1

The blurb you quote is re: upgrading. Upgrade has a specific meaning in the Drupal world. See Upgrading Drupal core.

Upgrading a Drupal site means a change of a major version, for example from Drupal 6 to Drupal 8 or from Drupal 7 to Drupal 8.

Upgrading assumes you want to bring all of the site's structure to your new site, that you literally want the same site, but with a newer Drupal Core as the foundation. Conceptually, it doesn't make sense to make changes to the structure before upgrading. As a result, changes will be reverted or altered during the process.

However, its perfectly acceptable to build a new Drupal site and then migrate your old content to the new site where appropriate - I do this all the time. I usually hear this labeled a redesign or a rebuild, vs upgrade.

Whether you choose to Upgrade or Redesign/Rebuild and migrate content is a decision you'll have to make based on the pros and cons for your particular situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.