SlideShare a Scribd company logo
25 -27 April, 2014 http://camp2014.drupal.dn.ua
Migrate -
new way site upgrade
Kirill Roskoliy
Email: roskoliy.kirill@gmail.com
DO: https://drupal.org/user/325151
Trellon, LLC
WHAT IS THIS ALL ABOUT:
1. How it was and how it will be
2. Migrate structure
3. Use cases
4. Requirements
5. Examples
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
How it was and how it will be
•In place upgrade - Drupal 7.x =<
•Migrate way
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
In place upgrade
This is standard upgrade path in Drupal 7 and previous. What does it
mean? Lets take a closer look:
1. We need to stage current site
1. Code
2. DB
3. Files
4. Done some pre-upgrade configuration
2. Put in place upgraded code
1. Remove old one
2. Put new
3. Start update.php
4. Pray that everything will go well, no? - Go to #1
5. Profit
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Migrate way of upgrade
1.No direct pruduction site modifications
2.Build new version of your site
3.Migrate
4.Issues ? - Go to #2
5.Profit
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Migrate module architecture
● Migration
○ MigrateSource
○ MigrateDestination
○ MigrateMap
○ MigrateFieldMapping
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Use cases
● Major version upgrade
● Site structure redesign
● Migration from other CMS
● Migration from static HTML
● Initial data import
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Requerments
Sources:
● DB access
● Files access
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Example: Content type migration 1
<?php
class SomeArticlesMigration extends DrupalNode7Migration {
public function __construct($arguments) {
$files_path = $arguments['source_domain_root'] . '/sites/default/files';
$this->description = t('Import article nodes.');
// Pulling extra fields to source row.
$this->sourceFields['field_tags'] = 'Tags for the article';
$this->sourceFields['field_image'] = 'Header Image';
$this->sourceFields['field_multi_images_upload'] = 'Multi images upload';
$this->sourceFields['field_article_comment_header'] = 'Comment Header';
$this->sourceFields['field_juicebox_gallery'] = 'Juicebox Gallery';
$this->sourceFields['field_embed_map'] = 'Embed Map';
$this->sourceFields['field_map_location'] = 'Map Location';
parent::__construct($arguments);
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Example: Content type migration 2
// Field mappings.
// Field field_tags.
$this->addFieldMapping('field_tags', 'field_tags');
$this->addFieldMapping('field_tags:source_type')->defaultValue('tid');
$this->addFieldMapping('field_tags:create_term')->defaultValue(TRUE);
$this->addFieldMapping('field_tags:ignore_case')->defaultValue(TRUE);
// Field field_image.
$this->addFieldMapping('field_image', 'field_image');
$this->addFieldMapping('field_image:file_class')->defaultValue(‘SomeArticleImages’);
$this->addFieldMapping('field_image:source_dir')->defaultValue($files_path . '/field/image/');
$this->addFieldMapping('field_image:destination_dir')->defaultValue('public://field/image/');
$this->addFieldMapping('field_image:file_replace')->defaultValue(FILE_EXISTS_REPLACE);
$this->addFieldMapping('field_image:preserve_files')->defaultValue(FALSE);
$this->addFieldMapping('field_image:alt', 'field_image:alt');
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Example: Content type migration 3
// Field field_article_comment_header - simple text field.
$this->addFieldMapping('field_article_comment_header', 'field_article_comment_header');
// Field field_embed_map - boolean field.
$this->addFieldMapping('field_embed_map', 'field_embed_map');
// Field field_map_location - geofield.
$this->addFieldMapping('field_map_location', 'field_map_location');
$this->addFieldMapping('field_map_location:lng', 'field_map_location:lng')
->callbacks('coconuts_migrate_map_location_lng');;
}
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Example: Content type migration 4
/**
* Limit selecting nodes only to those assigned to specified source domain.
* @return QueryConditionInterface
* Modified $query object.
*/
protected function query() {
$query = parent::query();
$source_domain_id = (int) $this->arguments['source_domain_id'];
$query->join('domain_access', 'da', 'da.nid = n.nid');
// Limit nodes to source domain and to those for ALL domains(gid == 0).
$query->condition('da.gid', array(0, $source_domain_id));
return $query;
}
protected function preImport() {
$some_dummy_code_here = TRUE;
}
}
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
Example: Helper class to migrate images
<?php
class SomeArticleImages extends MigrateFileUri {
public function __construct($arguments = array(), $default_file = NULL) {
parent::__construct($arguments, $default_file);
}
public function processFile($value, $owner) {
$filename = Database::getConnection('default', SOME_MIGRATE_CONNECTION_KEY)
->select('file_managed', 'f')
->fields('f', array('filename'))
->condition('fid', $value)
->execute()
->fetchField();
return parent::processFile($filename, $owner);
}
}
25 -27 April, 2014 http://camp2014.drupal.dn.ua/
THANK YOU!
Questions?
Kirill Roskoliy
Email: roskoliy.kirill@gmail.com
DO: https://drupal.org/user/325151
Trellon, LLC

More Related Content

What's hot

Slim RedBeanPHP and Knockout
Slim RedBeanPHP and KnockoutSlim RedBeanPHP and Knockout
Slim RedBeanPHP and Knockout
Vic Metcalfe
 
Keeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkKeeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkJeremy Kendall
 
Amp and higher computing science
Amp and higher computing scienceAmp and higher computing science
Amp and higher computing science
Charlie Love
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
Abdul Malik Ikhsan
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
Marek Sotak
 
Asset Pipeline
Asset PipelineAsset Pipeline
Asset Pipeline
Eric Berry
 
4.7 Automate Loading Data with Little to No Duplicates!
4.7 Automate Loading Data with Little to No Duplicates!4.7 Automate Loading Data with Little to No Duplicates!
4.7 Automate Loading Data with Little to No Duplicates!
TargetX
 
Pourquoi WordPress n’est pas un CMS
Pourquoi WordPress n’est pas un CMSPourquoi WordPress n’est pas un CMS
Pourquoi WordPress n’est pas un CMSThomas Gasc
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingMarek Sotak
 
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noCan WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Morten Rand-Hendriksen
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
Jeremy Kendall
 
Getting Started-with-Laravel
Getting Started-with-LaravelGetting Started-with-Laravel
Getting Started-with-Laravel
Mindfire Solutions
 
Drupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechDrupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotech
Mandakini Kumari
 
Laravel 101
Laravel 101Laravel 101
Laravel 101
Commit University
 
Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...
Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...
Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...
Puppet
 
Configuration resources
Configuration resourcesConfiguration resources
Configuration resources
Ashton Williams
 

What's hot (16)

Slim RedBeanPHP and Knockout
Slim RedBeanPHP and KnockoutSlim RedBeanPHP and Knockout
Slim RedBeanPHP and Knockout
 
Keeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkKeeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro Framework
 
Amp and higher computing science
Amp and higher computing scienceAmp and higher computing science
Amp and higher computing science
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
 
Asset Pipeline
Asset PipelineAsset Pipeline
Asset Pipeline
 
4.7 Automate Loading Data with Little to No Duplicates!
4.7 Automate Loading Data with Little to No Duplicates!4.7 Automate Loading Data with Little to No Duplicates!
4.7 Automate Loading Data with Little to No Duplicates!
 
Pourquoi WordPress n’est pas un CMS
Pourquoi WordPress n’est pas un CMSPourquoi WordPress n’est pas un CMS
Pourquoi WordPress n’est pas un CMS
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 Theming
 
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noCan WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
 
Getting Started-with-Laravel
Getting Started-with-LaravelGetting Started-with-Laravel
Getting Started-with-Laravel
 
Drupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechDrupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotech
 
Laravel 101
Laravel 101Laravel 101
Laravel 101
 
Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...
Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...
Puppet Camp DC 2015: Stop Writing Puppet Modules: A Guide to Best Practices i...
 
Configuration resources
Configuration resourcesConfiguration resources
Configuration resources
 

Viewers also liked

How did lenin tackle the problems he faced
How did lenin tackle the problems he facedHow did lenin tackle the problems he faced
How did lenin tackle the problems he facedcnewmanbsh
 
Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.DrupalCampDN
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalCampDN
 
Drupal Perfomance issues, tips & tricks. Антон Иванов.
Drupal Perfomance issues, tips & tricks. Антон Иванов.Drupal Perfomance issues, tips & tricks. Антон Иванов.
Drupal Perfomance issues, tips & tricks. Антон Иванов.DrupalCampDN
 
Grècia antiga
Grècia antigaGrècia antiga
Grècia antigampsanfe
 
May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...
DrupalCampDN
 

Viewers also liked (6)

How did lenin tackle the problems he faced
How did lenin tackle the problems he facedHow did lenin tackle the problems he faced
How did lenin tackle the problems he faced
 
Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
 
Drupal Perfomance issues, tips & tricks. Антон Иванов.
Drupal Perfomance issues, tips & tricks. Антон Иванов.Drupal Perfomance issues, tips & tricks. Антон Иванов.
Drupal Perfomance issues, tips & tricks. Антон Иванов.
 
Grècia antiga
Grècia antigaGrècia antiga
Grècia antiga
 
May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...
 

Similar to Migrate - new way site upgrade

Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28th
Chris Adams
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
Alexandru Badiu
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Mike Schinkel
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal API
Alexandru Badiu
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp Atlanta
Chris Scott
 
Creating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without SwearingCreating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without Swearingmartinwolak
 
Resource Routing in ExpressionEngine
Resource Routing in ExpressionEngineResource Routing in ExpressionEngine
Resource Routing in ExpressionEngine
MichaelRog
 
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Samuel Solís Fuentes
 
Fapi
FapiFapi
15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-search15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-search
Razvan Raducanu, PhD
 
Trucker
TruckerTrucker
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
Razvan Raducanu, PhD
 
Maintaining your own branch of Drupal core
Maintaining your own branch of Drupal coreMaintaining your own branch of Drupal core
Maintaining your own branch of Drupal core
drumm
 
State of search | drupalcon dublin
State of search | drupalcon dublinState of search | drupalcon dublin
State of search | drupalcon dublin
Joris Vercammen
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHPHari K T
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
Paul Bearne
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with example
Katy Slemon
 
Lessons from a Dying CMS
Lessons from a Dying CMSLessons from a Dying CMS
Lessons from a Dying CMS
Sandy Smith
 
[WLDN] Supercharging word press development in 2018
[WLDN] Supercharging word press development in 2018[WLDN] Supercharging word press development in 2018
[WLDN] Supercharging word press development in 2018
Adam Tomat
 

Similar to Migrate - new way site upgrade (20)

Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28th
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal API
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp Atlanta
 
Creating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without SwearingCreating WordPress Theme Faster, Smarter & Without Swearing
Creating WordPress Theme Faster, Smarter & Without Swearing
 
Resource Routing in ExpressionEngine
Resource Routing in ExpressionEngineResource Routing in ExpressionEngine
Resource Routing in ExpressionEngine
 
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
 
Fapi
FapiFapi
Fapi
 
15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-search15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-search
 
Trucker
TruckerTrucker
Trucker
 
ApacheCon 2005
ApacheCon 2005ApacheCon 2005
ApacheCon 2005
 
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
 
Maintaining your own branch of Drupal core
Maintaining your own branch of Drupal coreMaintaining your own branch of Drupal core
Maintaining your own branch of Drupal core
 
State of search | drupalcon dublin
State of search | drupalcon dublinState of search | drupalcon dublin
State of search | drupalcon dublin
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with example
 
Lessons from a Dying CMS
Lessons from a Dying CMSLessons from a Dying CMS
Lessons from a Dying CMS
 
[WLDN] Supercharging word press development in 2018
[WLDN] Supercharging word press development in 2018[WLDN] Supercharging word press development in 2018
[WLDN] Supercharging word press development in 2018
 

More from DrupalCampDN

Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef DabernigDrupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef DabernigDrupalCampDN
 
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqweDependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
DrupalCampDN
 
Our AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew BoagOur AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew Boag
DrupalCampDN
 
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем МирошникGuzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
DrupalCampDN
 
Blocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef DabernigBlocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef Dabernig
DrupalCampDN
 
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman SeferovCKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
DrupalCampDN
 
Drush - use full power - Alexander Schedrov
Drush - use full power - Alexander SchedrovDrush - use full power - Alexander Schedrov
Drush - use full power - Alexander Schedrov
DrupalCampDN
 
Это Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей ЧерноусЭто Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей Черноус
DrupalCampDN
 
Caching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander ShumenkoCaching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander Shumenko
DrupalCampDN
 
Rich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим ВалуевRich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим Валуев
DrupalCampDN
 
Panels как философия - Alexander Danilenko
Panels как философия - Alexander DanilenkoPanels как философия - Alexander Danilenko
Panels как философия - Alexander Danilenko
DrupalCampDN
 
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals   maksym moskvychevTwig internals - Maksym MoskvychevTwig internals   maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
DrupalCampDN
 
Презентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury GlushkovПрезентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury GlushkovDrupalCampDN
 
Drupal and Outer space - Martin Mayer
Drupal and Outer space - Martin MayerDrupal and Outer space - Martin Mayer
Drupal and Outer space - Martin Mayer
DrupalCampDN
 
Boost your theming skills - Artem Shymko
Boost your theming skills - Artem ShymkoBoost your theming skills - Artem Shymko
Boost your theming skills - Artem Shymko
DrupalCampDN
 
Continious integration - Иван Лещёв
Continious integration - Иван ЛещёвContinious integration - Иван Лещёв
Continious integration - Иван ЛещёвDrupalCampDN
 
Rules - Yaroslav Doroshuk
Rules - Yaroslav DoroshukRules - Yaroslav Doroshuk
Rules - Yaroslav DoroshukDrupalCampDN
 
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...DrupalCampDN
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel MakhrinskyDrupalCampDN
 
Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.DrupalCampDN
 

More from DrupalCampDN (20)

Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef DabernigDrupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
 
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqweDependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
 
Our AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew BoagOur AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew Boag
 
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем МирошникGuzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
 
Blocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef DabernigBlocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef Dabernig
 
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman SeferovCKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
 
Drush - use full power - Alexander Schedrov
Drush - use full power - Alexander SchedrovDrush - use full power - Alexander Schedrov
Drush - use full power - Alexander Schedrov
 
Это Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей ЧерноусЭто Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей Черноус
 
Caching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander ShumenkoCaching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander Shumenko
 
Rich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим ВалуевRich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим Валуев
 
Panels как философия - Alexander Danilenko
Panels как философия - Alexander DanilenkoPanels как философия - Alexander Danilenko
Panels как философия - Alexander Danilenko
 
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals   maksym moskvychevTwig internals - Maksym MoskvychevTwig internals   maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
 
Презентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury GlushkovПрезентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury Glushkov
 
Drupal and Outer space - Martin Mayer
Drupal and Outer space - Martin MayerDrupal and Outer space - Martin Mayer
Drupal and Outer space - Martin Mayer
 
Boost your theming skills - Artem Shymko
Boost your theming skills - Artem ShymkoBoost your theming skills - Artem Shymko
Boost your theming skills - Artem Shymko
 
Continious integration - Иван Лещёв
Continious integration - Иван ЛещёвContinious integration - Иван Лещёв
Continious integration - Иван Лещёв
 
Rules - Yaroslav Doroshuk
Rules - Yaroslav DoroshukRules - Yaroslav Doroshuk
Rules - Yaroslav Doroshuk
 
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel Makhrinsky
 
Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.
 

Recently uploaded

国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
nhiyenphan2005
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 

Recently uploaded (20)

国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 

Migrate - new way site upgrade

  • 1. 25 -27 April, 2014 http://camp2014.drupal.dn.ua Migrate - new way site upgrade Kirill Roskoliy Email: roskoliy.kirill@gmail.com DO: https://drupal.org/user/325151 Trellon, LLC
  • 2. WHAT IS THIS ALL ABOUT: 1. How it was and how it will be 2. Migrate structure 3. Use cases 4. Requirements 5. Examples 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 3. How it was and how it will be •In place upgrade - Drupal 7.x =< •Migrate way 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 4. In place upgrade This is standard upgrade path in Drupal 7 and previous. What does it mean? Lets take a closer look: 1. We need to stage current site 1. Code 2. DB 3. Files 4. Done some pre-upgrade configuration 2. Put in place upgraded code 1. Remove old one 2. Put new 3. Start update.php 4. Pray that everything will go well, no? - Go to #1 5. Profit 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 5. Migrate way of upgrade 1.No direct pruduction site modifications 2.Build new version of your site 3.Migrate 4.Issues ? - Go to #2 5.Profit 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 6. Migrate module architecture ● Migration ○ MigrateSource ○ MigrateDestination ○ MigrateMap ○ MigrateFieldMapping 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 7. Use cases ● Major version upgrade ● Site structure redesign ● Migration from other CMS ● Migration from static HTML ● Initial data import 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 8. Requerments Sources: ● DB access ● Files access 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 9. Example: Content type migration 1 <?php class SomeArticlesMigration extends DrupalNode7Migration { public function __construct($arguments) { $files_path = $arguments['source_domain_root'] . '/sites/default/files'; $this->description = t('Import article nodes.'); // Pulling extra fields to source row. $this->sourceFields['field_tags'] = 'Tags for the article'; $this->sourceFields['field_image'] = 'Header Image'; $this->sourceFields['field_multi_images_upload'] = 'Multi images upload'; $this->sourceFields['field_article_comment_header'] = 'Comment Header'; $this->sourceFields['field_juicebox_gallery'] = 'Juicebox Gallery'; $this->sourceFields['field_embed_map'] = 'Embed Map'; $this->sourceFields['field_map_location'] = 'Map Location'; parent::__construct($arguments); 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 10. Example: Content type migration 2 // Field mappings. // Field field_tags. $this->addFieldMapping('field_tags', 'field_tags'); $this->addFieldMapping('field_tags:source_type')->defaultValue('tid'); $this->addFieldMapping('field_tags:create_term')->defaultValue(TRUE); $this->addFieldMapping('field_tags:ignore_case')->defaultValue(TRUE); // Field field_image. $this->addFieldMapping('field_image', 'field_image'); $this->addFieldMapping('field_image:file_class')->defaultValue(‘SomeArticleImages’); $this->addFieldMapping('field_image:source_dir')->defaultValue($files_path . '/field/image/'); $this->addFieldMapping('field_image:destination_dir')->defaultValue('public://field/image/'); $this->addFieldMapping('field_image:file_replace')->defaultValue(FILE_EXISTS_REPLACE); $this->addFieldMapping('field_image:preserve_files')->defaultValue(FALSE); $this->addFieldMapping('field_image:alt', 'field_image:alt'); 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 11. Example: Content type migration 3 // Field field_article_comment_header - simple text field. $this->addFieldMapping('field_article_comment_header', 'field_article_comment_header'); // Field field_embed_map - boolean field. $this->addFieldMapping('field_embed_map', 'field_embed_map'); // Field field_map_location - geofield. $this->addFieldMapping('field_map_location', 'field_map_location'); $this->addFieldMapping('field_map_location:lng', 'field_map_location:lng') ->callbacks('coconuts_migrate_map_location_lng');; } 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 12. Example: Content type migration 4 /** * Limit selecting nodes only to those assigned to specified source domain. * @return QueryConditionInterface * Modified $query object. */ protected function query() { $query = parent::query(); $source_domain_id = (int) $this->arguments['source_domain_id']; $query->join('domain_access', 'da', 'da.nid = n.nid'); // Limit nodes to source domain and to those for ALL domains(gid == 0). $query->condition('da.gid', array(0, $source_domain_id)); return $query; } protected function preImport() { $some_dummy_code_here = TRUE; } } 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 13. Example: Helper class to migrate images <?php class SomeArticleImages extends MigrateFileUri { public function __construct($arguments = array(), $default_file = NULL) { parent::__construct($arguments, $default_file); } public function processFile($value, $owner) { $filename = Database::getConnection('default', SOME_MIGRATE_CONNECTION_KEY) ->select('file_managed', 'f') ->fields('f', array('filename')) ->condition('fid', $value) ->execute() ->fetchField(); return parent::processFile($filename, $owner); } } 25 -27 April, 2014 http://camp2014.drupal.dn.ua/
  • 14. THANK YOU! Questions? Kirill Roskoliy Email: roskoliy.kirill@gmail.com DO: https://drupal.org/user/325151 Trellon, LLC