Migrate drupal 6 to Drupal 8 using Drupal migrate module

Migrate in drupal means, Migrating configuration and data from old drupal site to new Drupal 8

In drupal 8 now migrate, replaced the old upgrade process that was used in privious versions of drupal. upgrade system is now dropped and import and data transformations now will happen druring migration.

Migrating in drupal 7 involved defining your fields mapping and manually creating the new content types. This is no longer necessary in drupal 8.

In Drupal 8 migrations automatically create content types and map fields between old site and new site. This leads to very less configuration to be done for migration from older version to drupal 8

Why Migrate from Drupal 6 to Drupal 8 ? Why not Drupal 7 to Drupal 8?

migration from drupal 7 will come soon, developement is in process now. For now Drpal-6 code is finalizing. In Drupal 8, It not longer support data migration from drupal 7 using upgrade process.

Migration from drupal 6 to drupal 8

Prerequisites

  • PHP 5.4
  • git
  • Drual 7.x(dev). (Lower version doesn’t suport Drupal 8. To use migrate you need to have the most up to date version of drush 7.x How to Install Drush 7 for Drupal 8 in linux )
  • Comfortable with Commandline (There is no GUI at this momment,you need to do the things using commands)

Manifest file

First step of migration is to create manifest file for the migrate module to operate on. Its just a simple text file,that needs to be in root directory of drupal 8.

These are things that needs to be keep in mind, while creating manifest file.

  • This file contains the migrations to be executed.
  • For migratio you need to include all the dependencies in file.
  • you can include comment by # character.

Here is a simple example to run the Druapl 6 node migration

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#for user and user roles including profile fields
- d6_user
- d6_user_contact_settings
- d6_user_mail
- d6_user_picture_entity_display
- d6_user_picture_entity_form_display
- d6_user_picture_field
- d6_user_picture_field_instance
- d6_user_picture_file
- d6_user_profile_entity_display
- d6_user_profile_entity_form_display
- d6_user_profile_field
- d6_user_profile_field_instance
- d6_user_role
- d6_user_settings
 
#for node and node types
- d6_node
- d6_node_revision
- d6_node_setting_promote
- d6_node_setting_status
- d6_node_setting_sticky
- d6_node_settings
- d6_node_type
- d6_field
- d6_field_formatter_settings
- d6_field_instance
- d6_field_instance_widget_settings
- d6_file
- d6_file_settings
- d6_filter_format
- d6_view_modes
#for cck fields
- d6_cck_field_revision:*
- d6_cck_field_values:*

you can download the complete manifest file for all drupal 6 to drupal 8 migratio from https://drupal.org/node/2221779

Now last step of migraton is executing migratio using command line.
Open terminal and go to drupal 8 root directry and run following command.

/** Enable drupal migrate module **/
 
drush en migrate_drupal -y
 
/**RUN MIGRATION **/
drush migrate-manifest --legacy-db-url=mysql://<username>:<password>@<host>:<portno>/<db_name> <manifest-filename>

Problem with drupal 6 drupal 8 migration

Migration from drupal 6 to drupal 8 is very easy and fast, but this process has few issues. Some Major issues and fixes are:

  • It doesn’t migrate node reference and user reference fields. (I have created two modules for that which create text field on drupal 6 for reference fields and later you need to manually create refernce fields in each content type manually(with same names) and run drupal 8 modules. Which will fill all the refernce fields with actual content. I’ll post guide for each in later post)
  • It doesn’t properly migrate checkboxes/radio button because on drupal 6 there we could put key value pair for checkbox and radio buttons. but on drupal 8 it can only have on off button with value 0 and 1. (You can overcome this by mapping fields type, I did this on one project. Please check this on https://www.codeinsects.com/drupal-6d6-to-drupal-8-d8-cck-single-onoff-checkbox-checkboxes-fix.html)
  • Before doing migration new modules and theme should be enabled on new drupal 8 installation
  • Only the default, short, medium and long formats are migrated. All other formats need to be reconfigured after migration.

Comments
  1. Tok
    • Ghan

Leave a Reply

Your email address will not be published. Required fields are marked *

*


Skip to toolbar