2.3 KiB
Demo Migration Module
This is a heavily redacted version of the module that was used in one of my projects. It was created to import node, paragraph and media content from CSV files.
Installation
Step 1: Add with Composer:
Please add the following snippet to the repositories section of your Drupal project's root composer.json file:
{
"type": "vcs",
"url": "https://akhado.wezbyte.com/WezByte-Public/cdesai-migration"
}
Add the module to your project:
composer require drupal/cdesai_migration
Step 2: Enable the Module:
Using Drupal Website
- Navigate to the Extend page (admin/modules) via the Manage administrative menu
- Locate the module(s) you wish to enable and check the box next to each one
- Click Install to enable (turn on) the new module(s)
Refer to https://www.drupal.org/docs/extending-drupal/installing-modules#s-step-2-enable-the-module
Prepare the Source Site
Prepare the Target Site
The target site should be running Drupal 9.3 or higher. There are changes to the way file imports work that won't work in earlier versions.
@TODO List all requirements.
Enable the core Migrate module. Download and enable the Migrate Plus and Migrate Tools modules. Make sure to get the versions that are appropriate for the current version of core. Migrate Plus had 8.0 and 8.1 branches that only work with outdated versions of core, so currently you need version 8.2 of Migrate Plus.
Edit the Migration YAML Files
Copy the Drupal Import module (this module) into your module repository. Edit the YAML files in /config/optional to alter the JSON source url so it points to the domain for the source site created in the earlier step.
Run the Migration
Once you have the right information in the YAML files, enable the module. On the command line, type this:
drush migrate-status
@TODO Add instructions as migrations are developed.
It is important to note that if you alter the YAML files after you first install the module, you'll have to uninstall and then reinstall the module to get Migrate to see the YAML changes.
There is more information about the Migrate API on Drupal.org.