SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Slim RedBeanPHP and Knockout
Slim RedBeanPHP and KnockoutSlim RedBeanPHP and Knockout
Slim RedBeanPHP and KnockoutVic 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 scienceCharlie Love
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationAbdul Malik Ikhsan
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - LondonMarek Sotak
 
Asset Pipeline
Asset PipelineAsset Pipeline
Asset PipelineEric 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.noMorten 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 frameworkJeremy Kendall
 
Drupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechDrupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechMandakini Kumari
 
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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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 ...
 

Ähnlich wie 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 28thChris 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 APIAlexandru 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 AtlantaChris 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 ExpressionEngineMichaelRog
 
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
 
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-searchRazvan Raducanu, PhD
 
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel16.mysql stored procedures in laravel
16.mysql stored procedures in laravelRazvan 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 coredrumm
 
Convert modules from 6.x to 7.x
Convert modules from 6.x to 7.xConvert modules from 6.x to 7.x
Convert modules from 6.x to 7.xJoão Ventura
 
State of search | drupalcon dublin
State of search | drupalcon dublinState of search | drupalcon dublin
State of search | drupalcon dublinJoris 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-1919Paul 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 exampleKaty Slemon
 
Lessons from a Dying CMS
Lessons from a Dying CMSLessons from a Dying CMS
Lessons from a Dying CMSSandy Smith
 

Ähnlich wie 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
 
Convert modules from 6.x to 7.x
Convert modules from 6.x to 7.xConvert modules from 6.x to 7.x
Convert modules from 6.x to 7.x
 
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
 

Mehr von 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 - Стадник АндрейQweqweDrupalCampDN
 
Our AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew BoagOur AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew BoagDrupalCampDN
 
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 DabernigDrupalCampDN
 
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman SeferovCKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman SeferovDrupalCampDN
 
Drush - use full power - Alexander Schedrov
Drush - use full power - Alexander SchedrovDrush - use full power - Alexander Schedrov
Drush - use full power - Alexander SchedrovDrupalCampDN
 
Это 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 ShumenkoDrupalCampDN
 
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 DanilenkoDrupalCampDN
 
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 moskvychevDrupalCampDN
 
Презентация модуля 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 MayerDrupalCampDN
 
Boost your theming skills - Artem Shymko
Boost your theming skills - Artem ShymkoBoost your theming skills - Artem Shymko
Boost your theming skills - Artem ShymkoDrupalCampDN
 
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
 

Mehr von 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. Александр Даниленко.
 

Kürzlich hochgeladen

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 

Kürzlich hochgeladen (20)

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 

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