GithubHelp home page GithubHelp logo

migrate_demo's Introduction

Demo for "Intro to Migrate in Drupal 8"

This is demo code prepared for the Bangkok Drupal Meetup on March 31, 2016. It demonstrates a basic Drupal 7 to Drupal 8 content migration using the Migrate module and Drush. Content being migrated includes: organisations (nodes), countries (taxonony terms), and people (users). Drush scripts to populate sample content are included.

Slides: https://docs.google.com/presentation/d/1O5UpI0pJj7Yi1nhj8ZtEzbZzzAk1qUso7-n4uggenp0/pub?start=false&loop=false&delayms=5000

Screenshot of demo sites

Drupal 7 Setup

  1. drush make https://raw.githubusercontent.com/milesw/migrate_demo/master/d7.make migrate_demo_d7
  2. Install Drupal 7 Standard profile
  3. drush en -y migrate_demo
  4. drush populate-all

Drupal 8 Setup

  1. drush make https://raw.githubusercontent.com/milesw/migrate_demo/master/d8.make migrate_demo_d8

  2. Install Drupal 8 Standard profile

  3. drush en -y migrate_demo

  4. drush config-set "system.site" uuid "7322b825-4dc6-437e-9c00-0abfdc04ce8a"

  5. Load the d8_config.tar.gz from this repo at /admin/config/development/configuration/full/import (may need to delete shortcut entities from the database?)

  6. Add database connection for D7 site to D8 settings.php:

    $databases['migrate']['default'] = array (
      'database' => 'dbname',
      'username' => 'dbuser',
      'password' => 'dbpass',
      'host' => '127.0.0.1',
      'port' => '3306',
      'driver' => 'mysql',
    );
    
  7. drush migrate-status (if you see totals, database connection is good)

  8. drush migrate-import --all

Editing migrations

When you change the YAML config for a migration you need to reload the config. The recommended way seems to be reinstalling the module, but that can be a hassle.

The config_devel module includes a drush command for reloading config:

drush config-devel-import-one path/to/migrate.migration.users.yml

migrate_demo's People

Contributors

milesw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.