SlideShare a Scribd company logo
Мигрируем на Drupal 8! 
#dckiev14
About us 
Andy Postnikov http://dgo.to/@andypost 
Pavel Makhrinsky http://dgo.to/@gumanist
More then 2% of all sites 
How many sites are running Drupal 6 and 7?
Latest stats
10 Drupal myths 
●Box product 
●Lego 
●Contrib - themes, modules, libraries 
●Multilingual 
●Platform 
●Support 
●Community 
●Evolution
Go Drupal 8 
●PHP 5.4 - 5.5, 5.6.2 
●HTML 5 
●Libraries - jQuery 2.1 (3.0) 
●Modules 
●CDN - REST 
●Database
Common migration tasks 
●Planning 
oData mapping 
oDependencies management 
oData cleanup 
●Chicken 'n Egg handling 
●Continuous content lifecycle 
●Progress monitoring 
●Rollback results
What is the migrate module? 
Source => Process => Destination
Migrate vs Feeds 
Mostly indentical feature set: 
●Since 2009 but FeedAPI 2007 
●feeds is UI-oriented 
●feeds_tamper vs custom code 
●feeds has a lot of satelite modules
Migrate in Drupal 8 retrospective 
Signed after 6 weeks away from feature freeze 
https://www.drupal.org/node/1052692#comment-6620570 
Initial patch was commited November 21, 2013 
https://www.drupal.org/node/2125717#comment-8197259 
Drupal 6 to Drupal 8 patch April 23, 2014 
https://www.drupal.org/node/2121299#comment-8710315 
Still in progress of polishing 
https://groups.drupal.org/imp - weekly call
Processing
Mapping
Definition (yml-file) 
id: migrate_example_people 
source: 
plugin: migrate_example_people 
destination: 
plugin: entity:user 
md5_passwords: true 
process: 
name: 
- 
plugin: concat 
delimiter: . 
source: 
- first_name 
- last_name 
- 
plugin: callback 
callable: 
- 'DrupalComponentUtilityUnicode' 
- strtolower 
- 
plugin: callback 
callable: trim 
- 
plugin: dedupe_entity 
entity_type: user 
field: name 
mail: email 
pass: pass 
roles: 
- 
plugin: explode 
delimiter: ';' 
source: groups
Chicken and egg 
process: 
tid: tid 
vid: 
plugin: migration 
migration: d6_taxonomy_vocabulary 
source: vid 
parent: 
- 
plugin: skip_process_on_empty 
source: parent 
- 
plugin: migration 
migration: d6_taxonomy_term
Dependencies 
migration_dependencies: 
required: 
- d6_filter_format 
- d6_user_role 
- d6_user_picture_entity_display 
- d6_user_picture_entity_form_display 
optional: 
- d6_user_picture_file
Execution flow 
class MigrateExecutable { 
/** Performs an import operation - migrate items from source to destination. */ 
public function import() { 
$source = $this->getSource(); 
$id_map = $this->migration->getIdMap(); 
$source->rewind(); 
while ($source->valid()) { 
$row = $source->current(); 
$this->processRow($row); 
$destination_id_values = $destination->import($row, $id_map- 
>lookupDestinationId($this->sourceIdValues)); 
$id_map->saveIdMapping($row, $destination_id_values, $this- 
>sourceRowStatus, $this->rollbackAction); 
$source->next(); 
} 
}
Source plugins 
Provides source rows - mostly custom 
1.getIterator(): iterator producing rows 
2.prepareRow(): add more data to a row 
3.There are hooks for prepareRow() 
MigrateSourceInterface
Source example - core 
/** 
* Drupal 6 menu source from database. 
* 
* @MigrateSource( 
* id = "d6_menu", 
* source_provider = "menu" 
* ) 
*/ 
class Menu extends DrupalSqlBase { 
/** 
* {@inheritdoc} 
*/ 
public function query() { 
$query = $this->select('menu_custom', 'm') 
->fields('m', array('menu_name', 'title', 'description')); 
return $query; 
}
Source example - custom 
public function count() { 
if (is_array($this->getData())) { 
return count($this->getData()); 
} 
return 0; 
} 
public function getIterator() { 
return new ArrayIterator($this->getData()); 
} 
protected function getData() { 
if (!isset($this->data)) { 
$this->data = array(); 
foreach ($this->fetchDataFromYandexDirect() as $key => $value) { 
$this->data[$key] = (array) $value; 
} 
} 
return $this->data; 
}
Process plugins 
●Keys are destination properties 
●Values are process pipelines 
●Each pipeline is a series of process plugins + 
configuration 
●There are shorthands 
MigrateProcessInterface::transform()
Process pipelines 
process: 
id: 
- 
plugin: machine_name 
source: name 
- 
plugin: dedupe_entity 
entity_type: user_role 
field: id 
- 
plugin: user_update_8002 #custom
Process plugins shipped 
Constant values 
Plugins: 
get 
concat 
dedupebase 
iterator 
skip_row_if_not_set 
default_value 
extract 
flatten 
iterator 
migration 
skip_process_on_empty 
skip_row_on_empty 
static map 
machine_name 
dedupe_entity 
callback
Process plugin example 
public function transform($value, MigrateExecutable 
$migrate_executable, Row $row, $destination_property) { 
$new_value = $this->getTransliteration()- 
>transliterate($value, 
LanguageInterface::LANGCODE_DEFAULT, '_'); 
$new_value = strtolower($new_value); 
$new_value = preg_replace('/[^a-z0-9_]+/', '_', 
$new_value); 
return preg_replace('/_+/', '_', $new_value); 
}
Destination plugins 
●Does the actual import 
●Almost always provided by migrate module 
●Most common is entity:$entity_type 
oentity:node 
oentity:user 
●If you are writing one, you are doing it wrong 
MigrateDestinationInterface
Destination plugins shipped 
●Config 
●Entity 
●Null 
●for custom tables: url_alias, user_data… 
destination: 
plugin: config 
config_name: user.mail
Destination plugin example 
/** 
* {@inheritdoc} 
*/ 
public function import(Row $row, array $old_destination_id_values = 
array()) { 
$path = $this->aliasStorage->save( 
$row->getDestinationProperty('source'), 
$row->getDestinationProperty('alias'), 
$row->getDestinationProperty('langcode'), 
$old_destination_id_values ? $old_destination_id_values[0] : NULL 
); 
return array($path['pid']); 
}
Demo 
●Drush 
●UI sandbox
Drush or custom code 
Recommended way to execute - DRUSH 
Custom code: 
public function submitForm(array &$form, array &$form_state) { 
/** @var $migration DrupalmigrateEntityMigrationInterface */ 
$migration = entity_load('migration', $form_state['values']['migration']); 
$executable = new MigrateExecutable($migration, $this); 
$executable->import(); 
// Display statistics. 
$this->getStats($form, $form_state); 
$form_state['rebuild'] = TRUE; 
}
How to help 
Document driven development 
http://dgo.to/2127611 
Open issues of migration system: 
http://goo.gl/fmVNQl 
Drupal groups http://dgo.to/g/imp 
IRC: Freenode #drupal-migrate
Links 
https://www.drupal.org/upgrade/migrate 
https://www.drupal.org/node/2127611 
https://groups.drupal.org/imp 
IRC: Freenode #drupal-migrate
Questions & Discussions 
Andy Postnikov http://dgo.to/@andypost 
Pavel Makhrinsky http://dgo.to/@gumanist 
Kiev 2014

More Related Content

What's hot

Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web services
Michelangelo van Dam
 
Doctrine 2
Doctrine 2Doctrine 2
Doctrine 2
zfconfua
 
Use Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extensionUse Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extension
LINE Corporation
 
Practical PHP 5.3
Practical PHP 5.3Practical PHP 5.3
Practical PHP 5.3
Nate Abele
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Roel Hartman
 
Persistent Memoization with HTML5 indexedDB and jQuery Promises
Persistent Memoization with HTML5 indexedDB and jQuery PromisesPersistent Memoization with HTML5 indexedDB and jQuery Promises
Persistent Memoization with HTML5 indexedDB and jQuery PromisesRay Bellis
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
Lorna Mitchell
 
RxSwift to Combine
RxSwift to CombineRxSwift to Combine
RxSwift to Combine
Bo-Young Park
 
Tweaking the interactive grid
Tweaking the interactive gridTweaking the interactive grid
Tweaking the interactive grid
Roel Hartman
 
RxSwift to Combine
RxSwift to CombineRxSwift to Combine
RxSwift to Combine
Bo-Young Park
 
Modularity and Layered Data Model
Modularity and Layered Data ModelModularity and Layered Data Model
Modularity and Layered Data Model
Attila Jenei
 
Creating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with googleCreating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with google
Roel Hartman
 
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
Roel Hartman
 
Letswift19-clean-architecture
Letswift19-clean-architectureLetswift19-clean-architecture
Letswift19-clean-architecture
Jung Kim
 
Behavior driven oop
Behavior driven oopBehavior driven oop
Behavior driven oop
Piyush Verma
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
Michelangelo van Dam
 
Design Patterns in PHP5
Design Patterns in PHP5 Design Patterns in PHP5
Design Patterns in PHP5 Wildan Maulana
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf Conference
 
Things about Functional JavaScript
Things about Functional JavaScriptThings about Functional JavaScript
Things about Functional JavaScript
ChengHui Weng
 

What's hot (20)

Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web services
 
Doctrine 2
Doctrine 2Doctrine 2
Doctrine 2
 
Use Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extensionUse Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extension
 
Practical PHP 5.3
Practical PHP 5.3Practical PHP 5.3
Practical PHP 5.3
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 
Persistent Memoization with HTML5 indexedDB and jQuery Promises
Persistent Memoization with HTML5 indexedDB and jQuery PromisesPersistent Memoization with HTML5 indexedDB and jQuery Promises
Persistent Memoization with HTML5 indexedDB and jQuery Promises
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
RxSwift to Combine
RxSwift to CombineRxSwift to Combine
RxSwift to Combine
 
Tweaking the interactive grid
Tweaking the interactive gridTweaking the interactive grid
Tweaking the interactive grid
 
RxSwift to Combine
RxSwift to CombineRxSwift to Combine
RxSwift to Combine
 
Modularity and Layered Data Model
Modularity and Layered Data ModelModularity and Layered Data Model
Modularity and Layered Data Model
 
Creating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with googleCreating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with google
 
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
 
Letswift19-clean-architecture
Letswift19-clean-architectureLetswift19-clean-architecture
Letswift19-clean-architecture
 
Behavior driven oop
Behavior driven oopBehavior driven oop
Behavior driven oop
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Design Patterns in PHP5
Design Patterns in PHP5 Design Patterns in PHP5
Design Patterns in PHP5
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Things about Functional JavaScript
Things about Functional JavaScriptThings about Functional JavaScript
Things about Functional JavaScript
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 

Viewers also liked

Migrate in Drupal 8
Migrate in Drupal 8Migrate in Drupal 8
Migrate in Drupal 8
Alexei Gorobets
 
Migrating data to drupal 8
Migrating data to drupal 8Migrating data to drupal 8
Migrating data to drupal 8
Ignacio Sánchez Holgueras
 
Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
Migrating to Drupal 8: How to Migrate Your Content and Minimize the RisksMigrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
Acquia
 
My contribs - Андрей Березовский
My contribs -  Андрей БерезовскийMy contribs -  Андрей Березовский
My contribs - Андрей БерезовскийAndrey Yurtaev
 
Jquery selector optimization in drupal
Jquery selector optimization in drupalJquery selector optimization in drupal
Jquery selector optimization in drupalYury Glushkov
 
программа компас изменение судьбы
программа компас   изменение судьбыпрограмма компас   изменение судьбы
программа компас изменение судьбы
Liudmila Filippovets
 
Looking for Vulnerable Code. Vlad Savitsky
Looking for Vulnerable Code. Vlad SavitskyLooking for Vulnerable Code. Vlad Savitsky
Looking for Vulnerable Code. Vlad Savitsky
Vlad Savitsky
 
Доклад на DrupalCafe Minsk
Доклад на DrupalCafe MinskДоклад на DrupalCafe Minsk
Доклад на DrupalCafe Minsk
Алексей Колосов
 
Как зарабатывать друпал разработчику. Клют Иван
Как зарабатывать друпал разработчику. Клют ИванКак зарабатывать друпал разработчику. Клют Иван
Как зарабатывать друпал разработчику. Клют ИванPVasili
 
Что, зачем и каким образом следует проверять и тестировать перед запуском сай...
Что, зачем и каким образом следует проверять и тестировать перед запуском сай...Что, зачем и каким образом следует проверять и тестировать перед запуском сай...
Что, зачем и каким образом следует проверять и тестировать перед запуском сай...
Alexey Kostin
 
Boost your theming skills
Boost your theming skillsBoost your theming skills
Boost your theming skills
Artem Shymko
 
Репутационная работа по версии Стерно.ру
Репутационная работа по версии Стерно.руРепутационная работа по версии Стерно.ру
Репутационная работа по версии Стерно.ру
Sterno_ru
 
Drupal camp аутсорс услуг тестирования - реальность или вымысел-
Drupal camp  аутсорс услуг тестирования - реальность или вымысел-Drupal camp  аутсорс услуг тестирования - реальность или вымысел-
Drupal camp аутсорс услуг тестирования - реальность или вымысел-
Konstantin Osipenko
 
Wodby. cloud infrastructure platform
Wodby. cloud infrastructure platformWodby. cloud infrastructure platform
Wodby. cloud infrastructure platform
Chingis Sandanov
 
Алла Тюрина. Авторизация через Ldap
Алла Тюрина. Авторизация через LdapАлла Тюрина. Авторизация через Ldap
Алла Тюрина. Авторизация через Ldap
Ksenia Rogachenko
 

Viewers also liked (20)

Migrate in Drupal 8
Migrate in Drupal 8Migrate in Drupal 8
Migrate in Drupal 8
 
Migrating data to drupal 8
Migrating data to drupal 8Migrating data to drupal 8
Migrating data to drupal 8
 
Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
Migrating to Drupal 8: How to Migrate Your Content and Minimize the RisksMigrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
 
My contribs - Андрей Березовский
My contribs -  Андрей БерезовскийMy contribs -  Андрей Березовский
My contribs - Андрей Березовский
 
Jquery selector optimization in drupal
Jquery selector optimization in drupalJquery selector optimization in drupal
Jquery selector optimization in drupal
 
нанана
нананананана
нанана
 
программа компас изменение судьбы
программа компас   изменение судьбыпрограмма компас   изменение судьбы
программа компас изменение судьбы
 
Looking for Vulnerable Code. Vlad Savitsky
Looking for Vulnerable Code. Vlad SavitskyLooking for Vulnerable Code. Vlad Savitsky
Looking for Vulnerable Code. Vlad Savitsky
 
Доклад на DrupalCafe Minsk
Доклад на DrupalCafe MinskДоклад на DrupalCafe Minsk
Доклад на DrupalCafe Minsk
 
Как зарабатывать друпал разработчику. Клют Иван
Как зарабатывать друпал разработчику. Клют ИванКак зарабатывать друпал разработчику. Клют Иван
Как зарабатывать друпал разработчику. Клют Иван
 
Что, зачем и каким образом следует проверять и тестировать перед запуском сай...
Что, зачем и каким образом следует проверять и тестировать перед запуском сай...Что, зачем и каким образом следует проверять и тестировать перед запуском сай...
Что, зачем и каким образом следует проверять и тестировать перед запуском сай...
 
Boost your theming skills
Boost your theming skillsBoost your theming skills
Boost your theming skills
 
Drupal association slides us 2013
Drupal association slides us 2013Drupal association slides us 2013
Drupal association slides us 2013
 
Concept Fusion
Concept FusionConcept Fusion
Concept Fusion
 
Репутационная работа по версии Стерно.ру
Репутационная работа по версии Стерно.руРепутационная работа по версии Стерно.ру
Репутационная работа по версии Стерно.ру
 
Doc
DocDoc
Doc
 
141112 гчп cnews (2)
141112 гчп cnews (2)141112 гчп cnews (2)
141112 гчп cnews (2)
 
Drupal camp аутсорс услуг тестирования - реальность или вымысел-
Drupal camp  аутсорс услуг тестирования - реальность или вымысел-Drupal camp  аутсорс услуг тестирования - реальность или вымысел-
Drupal camp аутсорс услуг тестирования - реальность или вымысел-
 
Wodby. cloud infrastructure platform
Wodby. cloud infrastructure platformWodby. cloud infrastructure platform
Wodby. cloud infrastructure platform
 
Алла Тюрина. Авторизация через Ldap
Алла Тюрина. Авторизация через LdapАлла Тюрина. Авторизация через Ldap
Алла Тюрина. Авторизация через Ldap
 

Similar to Drupal 8 migrate!

Automating Drupal Migrations
Automating Drupal MigrationsAutomating Drupal Migrations
Automating Drupal Migrations
littleMAS
 
Migrating data into Drupal using the migrate module
Migrating data into Drupal using the migrate moduleMigrating data into Drupal using the migrate module
Migrating data into Drupal using the migrate module
Johan Gant
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2
Elizabeth Smith
 
Fatc
FatcFatc
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011camp_drupal_ua
 
Migrations
MigrationsMigrations
Migrations
Yaron Tal
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
Jonathan Felch
 
Opencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJS
buttyx
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
Alexander Varwijk
 
Quality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStormQuality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStorm
Michelangelo van Dam
 
DDD on example of Symfony (Webcamp Odessa 2014)
DDD on example of Symfony (Webcamp Odessa 2014)DDD on example of Symfony (Webcamp Odessa 2014)
DDD on example of Symfony (Webcamp Odessa 2014)Oleg Zinchenko
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
Darren Mothersele
 
Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?
Yevhen Kotelnytskyi
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
Vrann Tulika
 
Drupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency InjectionDrupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency Injection
Philip Norton
 
Laravel5 Introduction and essentials
Laravel5 Introduction and essentialsLaravel5 Introduction and essentials
Laravel5 Introduction and essentials
Pramod Kadam
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGap
Alex S
 
So S.O.L.I.D Fu - Designing Better Code
So S.O.L.I.D Fu - Designing Better CodeSo S.O.L.I.D Fu - Designing Better Code
So S.O.L.I.D Fu - Designing Better Code
Neil Crookes
 
Dmp hadoop getting_start
Dmp hadoop getting_startDmp hadoop getting_start
Dmp hadoop getting_start
Gim GyungJin
 

Similar to Drupal 8 migrate! (20)

Automating Drupal Migrations
Automating Drupal MigrationsAutomating Drupal Migrations
Automating Drupal Migrations
 
Migrating data into Drupal using the migrate module
Migrating data into Drupal using the migrate moduleMigrating data into Drupal using the migrate module
Migrating data into Drupal using the migrate module
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2
 
Fatc
FatcFatc
Fatc
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
 
Migrations
MigrationsMigrations
Migrations
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Opencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJS
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
 
Quality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStormQuality assurance for php projects with PHPStorm
Quality assurance for php projects with PHPStorm
 
DDD on example of Symfony (Webcamp Odessa 2014)
DDD on example of Symfony (Webcamp Odessa 2014)DDD on example of Symfony (Webcamp Odessa 2014)
DDD on example of Symfony (Webcamp Odessa 2014)
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
 
Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
Drupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency InjectionDrupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency Injection
 
Laravel5 Introduction and essentials
Laravel5 Introduction and essentialsLaravel5 Introduction and essentials
Laravel5 Introduction and essentials
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGap
 
So S.O.L.I.D Fu - Designing Better Code
So S.O.L.I.D Fu - Designing Better CodeSo S.O.L.I.D Fu - Designing Better Code
So S.O.L.I.D Fu - Designing Better Code
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Dmp hadoop getting_start
Dmp hadoop getting_startDmp hadoop getting_start
Dmp hadoop getting_start
 

Recently uploaded

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
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
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
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
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
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
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
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 

Recently uploaded (20)

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
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
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
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
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
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
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
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 

Drupal 8 migrate!

  • 2. About us Andy Postnikov http://dgo.to/@andypost Pavel Makhrinsky http://dgo.to/@gumanist
  • 3. More then 2% of all sites How many sites are running Drupal 6 and 7?
  • 5. 10 Drupal myths ●Box product ●Lego ●Contrib - themes, modules, libraries ●Multilingual ●Platform ●Support ●Community ●Evolution
  • 6. Go Drupal 8 ●PHP 5.4 - 5.5, 5.6.2 ●HTML 5 ●Libraries - jQuery 2.1 (3.0) ●Modules ●CDN - REST ●Database
  • 7. Common migration tasks ●Planning oData mapping oDependencies management oData cleanup ●Chicken 'n Egg handling ●Continuous content lifecycle ●Progress monitoring ●Rollback results
  • 8. What is the migrate module? Source => Process => Destination
  • 9. Migrate vs Feeds Mostly indentical feature set: ●Since 2009 but FeedAPI 2007 ●feeds is UI-oriented ●feeds_tamper vs custom code ●feeds has a lot of satelite modules
  • 10. Migrate in Drupal 8 retrospective Signed after 6 weeks away from feature freeze https://www.drupal.org/node/1052692#comment-6620570 Initial patch was commited November 21, 2013 https://www.drupal.org/node/2125717#comment-8197259 Drupal 6 to Drupal 8 patch April 23, 2014 https://www.drupal.org/node/2121299#comment-8710315 Still in progress of polishing https://groups.drupal.org/imp - weekly call
  • 13. Definition (yml-file) id: migrate_example_people source: plugin: migrate_example_people destination: plugin: entity:user md5_passwords: true process: name: - plugin: concat delimiter: . source: - first_name - last_name - plugin: callback callable: - 'DrupalComponentUtilityUnicode' - strtolower - plugin: callback callable: trim - plugin: dedupe_entity entity_type: user field: name mail: email pass: pass roles: - plugin: explode delimiter: ';' source: groups
  • 14. Chicken and egg process: tid: tid vid: plugin: migration migration: d6_taxonomy_vocabulary source: vid parent: - plugin: skip_process_on_empty source: parent - plugin: migration migration: d6_taxonomy_term
  • 15. Dependencies migration_dependencies: required: - d6_filter_format - d6_user_role - d6_user_picture_entity_display - d6_user_picture_entity_form_display optional: - d6_user_picture_file
  • 16. Execution flow class MigrateExecutable { /** Performs an import operation - migrate items from source to destination. */ public function import() { $source = $this->getSource(); $id_map = $this->migration->getIdMap(); $source->rewind(); while ($source->valid()) { $row = $source->current(); $this->processRow($row); $destination_id_values = $destination->import($row, $id_map- >lookupDestinationId($this->sourceIdValues)); $id_map->saveIdMapping($row, $destination_id_values, $this- >sourceRowStatus, $this->rollbackAction); $source->next(); } }
  • 17. Source plugins Provides source rows - mostly custom 1.getIterator(): iterator producing rows 2.prepareRow(): add more data to a row 3.There are hooks for prepareRow() MigrateSourceInterface
  • 18. Source example - core /** * Drupal 6 menu source from database. * * @MigrateSource( * id = "d6_menu", * source_provider = "menu" * ) */ class Menu extends DrupalSqlBase { /** * {@inheritdoc} */ public function query() { $query = $this->select('menu_custom', 'm') ->fields('m', array('menu_name', 'title', 'description')); return $query; }
  • 19. Source example - custom public function count() { if (is_array($this->getData())) { return count($this->getData()); } return 0; } public function getIterator() { return new ArrayIterator($this->getData()); } protected function getData() { if (!isset($this->data)) { $this->data = array(); foreach ($this->fetchDataFromYandexDirect() as $key => $value) { $this->data[$key] = (array) $value; } } return $this->data; }
  • 20. Process plugins ●Keys are destination properties ●Values are process pipelines ●Each pipeline is a series of process plugins + configuration ●There are shorthands MigrateProcessInterface::transform()
  • 21. Process pipelines process: id: - plugin: machine_name source: name - plugin: dedupe_entity entity_type: user_role field: id - plugin: user_update_8002 #custom
  • 22. Process plugins shipped Constant values Plugins: get concat dedupebase iterator skip_row_if_not_set default_value extract flatten iterator migration skip_process_on_empty skip_row_on_empty static map machine_name dedupe_entity callback
  • 23. Process plugin example public function transform($value, MigrateExecutable $migrate_executable, Row $row, $destination_property) { $new_value = $this->getTransliteration()- >transliterate($value, LanguageInterface::LANGCODE_DEFAULT, '_'); $new_value = strtolower($new_value); $new_value = preg_replace('/[^a-z0-9_]+/', '_', $new_value); return preg_replace('/_+/', '_', $new_value); }
  • 24. Destination plugins ●Does the actual import ●Almost always provided by migrate module ●Most common is entity:$entity_type oentity:node oentity:user ●If you are writing one, you are doing it wrong MigrateDestinationInterface
  • 25. Destination plugins shipped ●Config ●Entity ●Null ●for custom tables: url_alias, user_data… destination: plugin: config config_name: user.mail
  • 26. Destination plugin example /** * {@inheritdoc} */ public function import(Row $row, array $old_destination_id_values = array()) { $path = $this->aliasStorage->save( $row->getDestinationProperty('source'), $row->getDestinationProperty('alias'), $row->getDestinationProperty('langcode'), $old_destination_id_values ? $old_destination_id_values[0] : NULL ); return array($path['pid']); }
  • 28. Drush or custom code Recommended way to execute - DRUSH Custom code: public function submitForm(array &$form, array &$form_state) { /** @var $migration DrupalmigrateEntityMigrationInterface */ $migration = entity_load('migration', $form_state['values']['migration']); $executable = new MigrateExecutable($migration, $this); $executable->import(); // Display statistics. $this->getStats($form, $form_state); $form_state['rebuild'] = TRUE; }
  • 29. How to help Document driven development http://dgo.to/2127611 Open issues of migration system: http://goo.gl/fmVNQl Drupal groups http://dgo.to/g/imp IRC: Freenode #drupal-migrate
  • 30. Links https://www.drupal.org/upgrade/migrate https://www.drupal.org/node/2127611 https://groups.drupal.org/imp IRC: Freenode #drupal-migrate
  • 31. Questions & Discussions Andy Postnikov http://dgo.to/@andypost Pavel Makhrinsky http://dgo.to/@gumanist Kiev 2014