Migrating data
This chapter contains notes on migrating nodes, users and other entities into a Drupal website. It discusses tools to migrate data between staging and production, tools to migrate data as part of upgrading to a newer version of Drupal, and lso discusses tools to migrate data from a non-Drupal website to Drupal.
Table of contents
- Introduction
- Alternative methods
- Drupal extensions
- Other contributed Drupal extensions
- Other contributed Drupal extensions
- Scraping and cleaning
- Final word
Drupal projects discussed in this chapter: Node export, WordPress Migrate.
Introduction
This chapter is about migrating entities (mainly nodes) between websites built on non-compatible code bases.
Before starting data migration, it is recommended yo read the following documentation:
- DO: Choosing the upgrade approach
- DO: Upgrading from Drupal 6 or Drupal 7
- DO: Executing migrations (about using the Migrate API)
- DO Forum: DO Forum post
Alternative methods
Browser
This method migrates all content and users as well as the configuration. It does not provide much control over the process, but should work well on simpler Drupal 7 web sites without much customization.
Source: DO: Upgrade using web browser.
Drush
Source: DO: Upgrade using web browser.
Drupal extensions
These are the main extensions provided to help with migrations. Most of these are meant to be used along with drush.
Other contributed Drupal extensions
The notes below are on specific Drupal extensions that I've evaluated. These are:
Node export
The Node export project (8.x-1.0-alpha1) allows users to export nodes and then import it into another Drupal installation, or on the same site.
The use case for this extension is exporting legacy nodes to new Drupal versions, or export/import nodes between a staging and a production site running the same version of Drupal.
Can transfer data via files, or by copy-pasting.
You will need the same content types on both sites for the imports to work correctly, and ideally also relevant compatibility with fields, and modules.
It has 37K installs (2021-08). Uses UUID to maintain cross-reference.
Simple and intuitive interface. Instructions
in README.txt
. For quick export-import, copy-paste
between text blocks.
I've used it migrating content between alternate Drupal 7 development sites in the custom RBG project.
WordPress Migrate
The WordPress Migrate project (8.x-3.0-alpha5) helps migrating WordPress content into Drupal. It leverages Migrate Tools, Migrate Plus, CTools the Migrate API.I used it to migrate Morten's blog into Titan for Drupal 7. See “Appedix A: WP migration” in Titan implementation notes for a description of the process.
See also:
agiledrop.com: Migrate WordPress to Drupal.
It is a tutorial about how to use this extension to export XML from WordPres and import it into a Drupal site
using WordPress Migrate.
There is also: github.com/amitgoyal/d8_migrate_wordpress. I haven't tested it.
Other contributed Drupal extensions
This is a list of unreviewed modules that may be helpful for migrating content. The number is the number of reported users (as of August 2021),
The following only exists for D7 and are probably obsolete:
- Data export import – 3K, to migrate from D6 to D7.
- Drupal-to-Drupal data migration – 6K, uses Migrate API, different versions of Drupal.
- Migrate – 31K, API for migration, heterogenous content
- Stager – 1 user
- Universally Unique IDentifier – 80K, integrates with Features for migration In core for D8+.
Scraping and cleaning
To scrape and clean, wget is handy, followed by a
perl-script that extract the main page content. See
scrape_site.sh
for example of how to use wget,
and clean.pl
for cleaning. The most recent incarnations was
below the staging area of the PVN extranet [now lost].
Final word
Related chapters:
- Moving the code base between major versions – making a major upgrade of the code base.
- Upgrading extensions from D7 to D8 and later – upgrading extensions you maintain yourself.
- Backup and site migration – how to migrate sites between compatible Drupal versions (general).
- HNM backup & migration routines – site migration notes for HNM
- Create custom content types – using Configuration Management to export content types and settings.
- MS Word copy-pasting – title says it all.
- Migrating from WP Engine – WP to WP, done on behalf of Karde.
Other useful pages:
Last update: 2021-08-29 [gh].