SlideShare a Scribd company logo
April 2018
D8 - 220K websites
D7 - 900K websites
D6 - 60K websites
destination:
plugin: entity:user
/**
* @MigrateDestination(
* id = "entity:user"
* )
*/
class EntityUser extends EntityContentBase {
protected function save(ContentEntityInterface $entity, array $old_destination_id_values
= []) {
$entity->save();
return [$entity->id()];
}
roles: #roles are on a different table, but it is part of the user entity
plugin: migration_lookup
migration: d7_user_role
source: roles
roles: #roles are on a different table, but it is part of the user entity
plugin: migration_lookup
migration: d7_user_role
source: roles
# for nodes
destination:
plugin: 'entity:node'
default_bundle: admissions_event
# for user
destination:
plugin: 'entity:user'
source:
plugin: d7_user
# show User.php
class User extends FieldableEntity {
/**
* {@inheritdoc}
*/
public function query() {
return $this->select('users', 'u')
->fields('u')
->condition('u.uid', 0, '>');
}
public function fields() {
$fields = [
'uid' => $this->t('User ID'),
'name' => $this->t('Username'),
];
return $fields;
}
User::fields are the source data you can use later in process section of the template.
/**
* Drupal 7 user source from database.
*
* @MigrateSource(
* id = "d7_user",
* source_module = "user"
* )
*/
class User extends FieldableEntity {
being confident of this, that he who began a
good work in you will carry it on to completion
until the day of Christ Jesus.
# mapping using the short notation (implicitly uses get process plugin)
# destination:source
process:
uid: uid
name: name
pass: pass
mail: mail
# explicit mapping
# <destination_field>:
# plugin: <plugin_name>
# source: <source_field>
process:
langcode:
plugin: user_langcode
source: language
fallback_to_site_default: false
roles:
plugin: migration_lookup
migration: d7_user_role
source: roles
user_picture:
-
plugin: default_value
source: picture
default_value: null
-
plugin: migration_lookup
migration: d7_file
/**
* @MigrateProcessPlugin(
* id = "migration_lookup_neiu_current_vid"
* )
*/
class NeiuCurrentVid extends Get {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row
$row, $destination_property) {
$node = node_load($value);
return $node->getRevisionId();
}
}
# syntax
drush migrate-upgrade --configure-only --legacy-root=<website root> --legacy-db-key=<DB
key> --migration-prefix=<Migration Prefix>
Where:
legacy-root is for example http://mywebsite.com
legacy-db-key is your source d6/d7 db export defined in settings.php
migration-prefix is any value that will be used as a prefix for the files generated for migration
process:
nid: tnid #remove this line
vid: vid #remove this line
uid:
#migration_lookup is used to get the new uid from a previous user migration
plugin: migration_lookup
migration: hub_d7_user #the migration id of the previous user migration
source: uid
Freedom lies in being bold
1. Import the source database and define the connections in settings.php
2. Generate the migration template files using migrate_upgrade module:
drush migrate-upgrade --configure-only --legacy-root=<website root> --legacy-db-key=<DB key>
--migration-prefix=<Migration Prefix>
3. Export the migration template files using drush config-export:
drush cex
*** We need to export because it only exists in DB prior to this. Exporting will give the files to edit.
4. Edit/Delete the migration templates files into your config directory as needed.
*** Ideally, you will just be migrating content, users and taxonomy. Configurations/content types can be manually created.
5. Reimport your changes using drush config-import:
drush cim
6. Visit admin/structure/migrate and execute migrations (or rollback) as needed.
Usually migrations are not as desired on the first run and edits to the custom plugin or template must be
made. You can execute rollback and retry. If migration template changes are needed, step 5 must be
executed for template changes to take effect.
1. Migrate Tools contrib module for using drush to execute migrations.
2. Migrate Manifest contrib to group migrations in a manifest file.
3. Using stubs for migrating chicken or egg scenarios.
Go forth and multiply

More Related Content

What's hot

Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
Benjamin Eberlei
 
Doctrine for NoSQL
Doctrine for NoSQLDoctrine for NoSQL
Doctrine for NoSQL
Benjamin Eberlei
 
Drupal Step-by-Step: How We Built Our Training Site, Part 1
Drupal Step-by-Step: How We Built Our Training Site, Part 1Drupal Step-by-Step: How We Built Our Training Site, Part 1
Drupal Step-by-Step: How We Built Our Training Site, Part 1Acquia
 
Simple blog wall creation on Java
Simple blog wall creation on JavaSimple blog wall creation on Java
Simple blog wall creation on JavaMax Titov
 
Анатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to zАнатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to z
LEDC 2016
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
Richard Leland
 
Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...
Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...
Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...
DicodingEvent
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
Richard Leland
 
Backbone js
Backbone jsBackbone js
Backbone js
husnara mohammad
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
Nick Lee
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
Jeff Eaton
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
Rifat Nabi
 
Php5
Php5Php5
Codeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate UriCodeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate Uri
Abdul Malik Ikhsan
 
Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2
Manfred Steyer
 
Save data in to sqlite
Save data in to sqliteSave data in to sqlite
Save data in to sqlite
Junifar hidayat
 

What's hot (17)

jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
 
Doctrine for NoSQL
Doctrine for NoSQLDoctrine for NoSQL
Doctrine for NoSQL
 
Drupal Step-by-Step: How We Built Our Training Site, Part 1
Drupal Step-by-Step: How We Built Our Training Site, Part 1Drupal Step-by-Step: How We Built Our Training Site, Part 1
Drupal Step-by-Step: How We Built Our Training Site, Part 1
 
Simple blog wall creation on Java
Simple blog wall creation on JavaSimple blog wall creation on Java
Simple blog wall creation on Java
 
Анатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to zАнатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to z
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...
Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...
Dicoding Developer Coaching #32: Android | Reactive Programming dengan RxJava...
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Php5
Php5Php5
Php5
 
Codeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate UriCodeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate Uri
 
Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2
 
Save data in to sqlite
Save data in to sqliteSave data in to sqlite
Save data in to sqlite
 

Similar to Migrating Drupal 7 to Drupal 8

Yii in action
Yii in actionYii in action
Yii in action
KeaNy Chu
 
Drupal8 migrate
Drupal8 migrateDrupal8 migrate
Drupal8 migrate
John Doyle
 
Drupal 8 migrate!
Drupal 8 migrate!Drupal 8 migrate!
Drupal 8 migrate!
Pavel Makhrinsky
 
Migrating data to drupal 8
Migrating data to drupal 8Migrating data to drupal 8
Migrating data to drupal 8
Ignacio Sánchez Holgueras
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
Jonathan Wage
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
Lukas Smith
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
Nuvole
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
Christoffer Noring
 
Introduction to Polymer and Firebase - Simon Gauvin
Introduction to Polymer and Firebase - Simon GauvinIntroduction to Polymer and Firebase - Simon Gauvin
Introduction to Polymer and Firebase - Simon Gauvin
Simon Gauvin
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
DrupalDay
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your Code
DrupalDay
 
Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017
Atenea tech
 
08ui.pptx
08ui.pptx08ui.pptx
08ui.pptx
KabadaSori
 
Automating Drupal Migrations
Automating Drupal MigrationsAutomating Drupal Migrations
Automating Drupal Migrations
littleMAS
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
Alexander Varwijk
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13
Alfresco Software
 
Drupal 7 database api
Drupal 7 database api Drupal 7 database api
Drupal 7 database api
Andrii Podanenko
 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
James Titcumb
 
Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17
Dan Poltawski
 

Similar to Migrating Drupal 7 to Drupal 8 (20)

Yii in action
Yii in actionYii in action
Yii in action
 
Drupal8 migrate
Drupal8 migrateDrupal8 migrate
Drupal8 migrate
 
Drupal 8 migrate!
Drupal 8 migrate!Drupal 8 migrate!
Drupal 8 migrate!
 
Migrating data to drupal 8
Migrating data to drupal 8Migrating data to drupal 8
Migrating data to drupal 8
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
RESTful web services
RESTful web servicesRESTful web services
RESTful web services
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
Introduction to Polymer and Firebase - Simon Gauvin
Introduction to Polymer and Firebase - Simon GauvinIntroduction to Polymer and Firebase - Simon Gauvin
Introduction to Polymer and Firebase - Simon Gauvin
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your Code
 
Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017
 
08ui.pptx
08ui.pptx08ui.pptx
08ui.pptx
 
Automating Drupal Migrations
Automating Drupal MigrationsAutomating Drupal Migrations
Automating Drupal Migrations
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13
 
Drupal 7 database api
Drupal 7 database api Drupal 7 database api
Drupal 7 database api
 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
 
Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17Moodle 3.3 - API Change Overview #mootieuk17
Moodle 3.3 - API Change Overview #mootieuk17
 

More from Promet Source

How To Start Building Your Own Website With Drupal by Mary Chris Casis
How To Start Building Your Own Website With Drupal by Mary Chris CasisHow To Start Building Your Own Website With Drupal by Mary Chris Casis
How To Start Building Your Own Website With Drupal by Mary Chris Casis
Promet Source
 
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
DrupalCamp Cebu 2018 R&F by Andrew KucharskiDrupalCamp Cebu 2018 R&F by Andrew Kucharski
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
Promet Source
 
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Promet Source
 
Migrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan ManaloMigrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan Manalo
Promet Source
 
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Promet Source
 
Drupal Development with Docker
Drupal Development with DockerDrupal Development with Docker
Drupal Development with Docker
Promet Source
 
Web Accessibility in Drupal
Web Accessibility in DrupalWeb Accessibility in Drupal
Web Accessibility in Drupal
Promet Source
 
Drupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond JenkinsDrupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond Jenkins
Promet Source
 
Drupal 8 Involvement with Promet Source
Drupal 8 Involvement with Promet SourceDrupal 8 Involvement with Promet Source
Drupal 8 Involvement with Promet Source
Promet Source
 
Using Commerce License for Premium Content on Drupal Sites
Using Commerce License for Premium Content on Drupal SitesUsing Commerce License for Premium Content on Drupal Sites
Using Commerce License for Premium Content on Drupal Sites
Promet Source
 
Behavioral driven development with Behat
Behavioral driven development with BehatBehavioral driven development with Behat
Behavioral driven development with Behat
Promet Source
 
Composer tools and frameworks for Drupal
Composer tools and frameworks for DrupalComposer tools and frameworks for Drupal
Composer tools and frameworks for Drupal
Promet Source
 
Responsive Design Testing the Promet Way
Responsive Design Testing the Promet WayResponsive Design Testing the Promet Way
Responsive Design Testing the Promet Way
Promet Source
 
Optimize and succeed your next Fixed Budget Project planning process
Optimize and succeed your next Fixed Budget Project planning process Optimize and succeed your next Fixed Budget Project planning process
Optimize and succeed your next Fixed Budget Project planning process
Promet Source
 
Diy continuous integration
Diy continuous integrationDiy continuous integration
Diy continuous integration
Promet Source
 
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will comeHigher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Promet Source
 
Getting agile with drupal
Getting agile with drupalGetting agile with drupal
Getting agile with drupal
Promet Source
 
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Project Estimation Presentation - Donte's 8th level of estimating level of ef...Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Promet Source
 
DrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & ProfitableDrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & Profitable
Promet Source
 
DevOps for Drupal: Why We Cook With Chef
DevOps for Drupal: Why We Cook With ChefDevOps for Drupal: Why We Cook With Chef
DevOps for Drupal: Why We Cook With Chef
Promet Source
 

More from Promet Source (20)

How To Start Building Your Own Website With Drupal by Mary Chris Casis
How To Start Building Your Own Website With Drupal by Mary Chris CasisHow To Start Building Your Own Website With Drupal by Mary Chris Casis
How To Start Building Your Own Website With Drupal by Mary Chris Casis
 
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
DrupalCamp Cebu 2018 R&F by Andrew KucharskiDrupalCamp Cebu 2018 R&F by Andrew Kucharski
DrupalCamp Cebu 2018 R&F by Andrew Kucharski
 
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
Unit test in drupal 8 by Pratomo Ardianto Drupalcamp Cebu 2018
 
Migrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan ManaloMigrating to-Drupal-8 by Bryan Manalo
Migrating to-Drupal-8 by Bryan Manalo
 
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
 
Drupal Development with Docker
Drupal Development with DockerDrupal Development with Docker
Drupal Development with Docker
 
Web Accessibility in Drupal
Web Accessibility in DrupalWeb Accessibility in Drupal
Web Accessibility in Drupal
 
Drupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond JenkinsDrupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond Jenkins
 
Drupal 8 Involvement with Promet Source
Drupal 8 Involvement with Promet SourceDrupal 8 Involvement with Promet Source
Drupal 8 Involvement with Promet Source
 
Using Commerce License for Premium Content on Drupal Sites
Using Commerce License for Premium Content on Drupal SitesUsing Commerce License for Premium Content on Drupal Sites
Using Commerce License for Premium Content on Drupal Sites
 
Behavioral driven development with Behat
Behavioral driven development with BehatBehavioral driven development with Behat
Behavioral driven development with Behat
 
Composer tools and frameworks for Drupal
Composer tools and frameworks for DrupalComposer tools and frameworks for Drupal
Composer tools and frameworks for Drupal
 
Responsive Design Testing the Promet Way
Responsive Design Testing the Promet WayResponsive Design Testing the Promet Way
Responsive Design Testing the Promet Way
 
Optimize and succeed your next Fixed Budget Project planning process
Optimize and succeed your next Fixed Budget Project planning process Optimize and succeed your next Fixed Budget Project planning process
Optimize and succeed your next Fixed Budget Project planning process
 
Diy continuous integration
Diy continuous integrationDiy continuous integration
Diy continuous integration
 
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will comeHigher Ed Web 2013 presentation - Field of Dreams, build it and they will come
Higher Ed Web 2013 presentation - Field of Dreams, build it and they will come
 
Getting agile with drupal
Getting agile with drupalGetting agile with drupal
Getting agile with drupal
 
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Project Estimation Presentation - Donte's 8th level of estimating level of ef...Project Estimation Presentation - Donte's 8th level of estimating level of ef...
Project Estimation Presentation - Donte's 8th level of estimating level of ef...
 
DrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & ProfitableDrupalCon 2013 Making Support Fun & Profitable
DrupalCon 2013 Making Support Fun & Profitable
 
DevOps for Drupal: Why We Cook With Chef
DevOps for Drupal: Why We Cook With ChefDevOps for Drupal: Why We Cook With Chef
DevOps for Drupal: Why We Cook With Chef
 

Recently uploaded

Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 

Recently uploaded (20)

Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 

Migrating Drupal 7 to Drupal 8

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. April 2018 D8 - 220K websites D7 - 900K websites D6 - 60K websites
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. destination: plugin: entity:user /** * @MigrateDestination( * id = "entity:user" * ) */ class EntityUser extends EntityContentBase { protected function save(ContentEntityInterface $entity, array $old_destination_id_values = []) { $entity->save(); return [$entity->id()]; }
  • 15.
  • 16. roles: #roles are on a different table, but it is part of the user entity plugin: migration_lookup migration: d7_user_role source: roles
  • 17. roles: #roles are on a different table, but it is part of the user entity plugin: migration_lookup migration: d7_user_role source: roles
  • 18. # for nodes destination: plugin: 'entity:node' default_bundle: admissions_event # for user destination: plugin: 'entity:user'
  • 20.
  • 21. class User extends FieldableEntity { /** * {@inheritdoc} */ public function query() { return $this->select('users', 'u') ->fields('u') ->condition('u.uid', 0, '>'); }
  • 22.
  • 23. public function fields() { $fields = [ 'uid' => $this->t('User ID'), 'name' => $this->t('Username'), ]; return $fields; } User::fields are the source data you can use later in process section of the template.
  • 24. /** * Drupal 7 user source from database. * * @MigrateSource( * id = "d7_user", * source_module = "user" * ) */ class User extends FieldableEntity {
  • 25. being confident of this, that he who began a good work in you will carry it on to completion until the day of Christ Jesus.
  • 26. # mapping using the short notation (implicitly uses get process plugin) # destination:source process: uid: uid name: name pass: pass mail: mail
  • 27. # explicit mapping # <destination_field>: # plugin: <plugin_name> # source: <source_field> process: langcode: plugin: user_langcode source: language fallback_to_site_default: false roles: plugin: migration_lookup migration: d7_user_role source: roles
  • 28. user_picture: - plugin: default_value source: picture default_value: null - plugin: migration_lookup migration: d7_file
  • 29. /** * @MigrateProcessPlugin( * id = "migration_lookup_neiu_current_vid" * ) */ class NeiuCurrentVid extends Get { public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { $node = node_load($value); return $node->getRevisionId(); } }
  • 30.
  • 31. # syntax drush migrate-upgrade --configure-only --legacy-root=<website root> --legacy-db-key=<DB key> --migration-prefix=<Migration Prefix> Where: legacy-root is for example http://mywebsite.com legacy-db-key is your source d6/d7 db export defined in settings.php migration-prefix is any value that will be used as a prefix for the files generated for migration
  • 32.
  • 33.
  • 34. process: nid: tnid #remove this line vid: vid #remove this line uid: #migration_lookup is used to get the new uid from a previous user migration plugin: migration_lookup migration: hub_d7_user #the migration id of the previous user migration source: uid
  • 35.
  • 36. Freedom lies in being bold
  • 37. 1. Import the source database and define the connections in settings.php 2. Generate the migration template files using migrate_upgrade module: drush migrate-upgrade --configure-only --legacy-root=<website root> --legacy-db-key=<DB key> --migration-prefix=<Migration Prefix> 3. Export the migration template files using drush config-export: drush cex *** We need to export because it only exists in DB prior to this. Exporting will give the files to edit. 4. Edit/Delete the migration templates files into your config directory as needed. *** Ideally, you will just be migrating content, users and taxonomy. Configurations/content types can be manually created. 5. Reimport your changes using drush config-import: drush cim 6. Visit admin/structure/migrate and execute migrations (or rollback) as needed. Usually migrations are not as desired on the first run and edits to the custom plugin or template must be made. You can execute rollback and retry. If migration template changes are needed, step 5 must be executed for template changes to take effect.
  • 38. 1. Migrate Tools contrib module for using drush to execute migrations. 2. Migrate Manifest contrib to group migrations in a manifest file. 3. Using stubs for migrating chicken or egg scenarios.
  • 39. Go forth and multiply