http://rocketeerbkw.github.io/slides/austin-drupal-users-group/migrating-to-drupal-8/
The migrate module provides a flexible framework for migrating content into Drupal from other sources (e.g., when converting a web site from another CMS to Drupal).
# Download Drupal
drush dl
# Install with minimal profile
drush si minimal --account-name=admin --account-pass=admin --db-url=mysql://root@127.0.0.1/r8
# Download contrib modules
drush dl markdown pathauto token redirect google_analytics ctools migrate_upgrade
# Need 8.x-2.x of migrate_plus
drush dl --select migrate_plus
# Enable modules you want to migrate
drush en -y color contact block_content contextual menu_link_content options path rdf shortcut taxonomy link migrate_drupal_ui image toolbar markdown pathauto token redirect google_analytics migrate_upgrade
# Run the migration
# In the UI
http://r8.dev/upgrade
# Via drush
drush migrate-upgrade --legacy-db-url=mysql://root@127.0.0.1/r7 --legacy-root=/Users/rocketeerbkw/Sites/r7
Is contrib ready?
Custom modules?
Custom theme?
7 to 8 is probably not ready. But you can help!
6 to 8 is suppossed to have better support.
1. Export migrations as config instead of running
drush migrate-upgrade --configure-only --legacy-db-url=mysql://root@127.0.0.1/r7 --legacy-root=/Users/rocketeerbkw/Sites/r7
2. Configure source database in settings.php
3. Migrate vocabularies
drush mi upgrade_d7_taxonomy_vocabulary
4. Export, Modify, Import terms migration
uuid: 70ba6e1b-0149-48b9-893a-ad0611935860
langcode: en
status: true
dependencies: { }
id: upgrade_d7_taxonomy_term
migration_tags:
- 'Drupal 7'
migration_group: migrate_drupal_7
label: 'Taxonomy terms'
source:
plugin: taxonomy_term
process:
tid: tid
vid:
plugin: migration
migration: upgrade_d7_taxonomy_vocabulary
source: vid
name: name
description: description
weight: weight
parent:
plugin: migration
migration: upgrade_d7_taxonomy_term
source: parent
changed: timestamp
destination:
plugin: 'entity:taxonomy_term'
migration_dependencies:
required:
- upgrade_d7_taxonomy_vocabulary
optional: { }
uuid: 70ba6e1b-0149-48b9-893a-ad0611935860
langcode: en
status: true
dependencies: { }
id: upgrade_d7_taxonomy_term
migration_tags:
- 'Drupal 7'
migration_group: migrate_drupal_7
label: 'Taxonomy terms'
source:
plugin: taxonomy_term
process:
tid: tid
vid:
plugin: migration
migration: upgrade_d7_taxonomy_vocabulary
source: vid
name:
plugin: callback
callable: strtoupper
source: name
description: description
weight: weight
parent:
plugin: migration
migration: upgrade_d7_taxonomy_term
source: parent
changed: timestamp
destination:
plugin: 'entity:taxonomy_term'
migration_dependencies:
required:
- upgrade_d7_taxonomy_vocabulary
optional: { }
5. Rebuild cache
drush cache-rebuild
6. Migrate terms
drush mi upgrade_d7_taxonomy_term
1. Export migrations as config instead of running
drush migrate-upgrade --configure-only --legacy-db-url=mysql://root@127.0.0.1/r7 --legacy-root=/Users/rocketeerbkw/Sites/r7
2. Configure source database in settings.php
3. Custom module with custom source plugin
drupal generate:module
getSourceProperty('mail');
$new_mail = str_replace('@evilcorp.com', '@rockstars.io', $old_email);
$row->setSourceProperty('mail', $new_mail);
return parent::prepareRow($row);
}
}
4. Export, Modify, Import user migration
uuid: 72303b9e-6cd6-4c96-9ab2-e5c58a4697b7
langcode: en
status: true
dependencies: { }
id: upgrade_d7_user
migration_tags:
- 'Drupal 7'
migration_group: migrate_drupal_7
label: 'User accounts'
source:
plugin: d7_user
process:
uid: uid
name: name
pass: pass
mail: mail
created: created
access: access
login: login
status: status
timezone: timezone
langcode: language
preferred_langcode: language
preferred_admin_langcode: language
init: init
roles:
plugin: migration
migration: upgrade_d7_user_role
source: roles
user_picture:
-
plugin: default_value
source: picture
default_value: null
-
plugin: migration
migration: d7_file
destination:
plugin: 'entity:user'
migration_dependencies:
required:
- upgrade_d7_user_role
optional:
- upgrade_d7_file
- upgrade_user_picture_field_instance
- upgrade_user_picture_entity_display
- upgrade_user_picture_entity_form_display
uuid: 72303b9e-6cd6-4c96-9ab2-e5c58a4697b7
langcode: en
status: true
dependencies: { }
id: upgrade_d7_user
migration_tags:
- 'Drupal 7'
migration_group: migrate_drupal_7
label: 'User accounts'
source:
plugin: evilcorp_migrations_user
process:
uid: uid
name: name
pass: pass
mail: mail
created: created
access: access
login: login
status: status
timezone: timezone
langcode: language
preferred_langcode: language
preferred_admin_langcode: language
init: init
roles:
plugin: migration
migration: upgrade_d7_user_role
source: roles
user_picture:
-
plugin: default_value
source: picture
default_value: null
-
plugin: migration
migration: d7_file
destination:
plugin: 'entity:user'
migration_dependencies:
required:
- upgrade_d7_user_role
optional:
- upgrade_d7_file
- upgrade_user_picture_field_instance
- upgrade_user_picture_entity_display
- upgrade_user_picture_entity_form_display
5. Rebuild cache
drush cache-rebuild
6. Migrate users
drush mi --execute-dependencies upgrade_d7_user
The migrate module was originally created to facilitate migrations from platforms other than Drupal.
All the concepts used for migrating from Drupal 7 can just as easily be used to migrate from WordPress, Joomla!, etc.
@rocketeerbkw
rocketeerbkw@gmail.com
rocketeerbkw.com