SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
Jeremy Kendall
 
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 CMS
Thomas Gasc
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 Theming
Marek Sotak
 

La actualidad más candente (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
 

Destacado

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
cnewmanbsh
 
Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.
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 antiga
mpsanfe
 

Destacado (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 a Migrate - new way site upgrade

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
martinwolak
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
Hari K T
 

Similar a 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
 

Más de 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 Dabernig
DrupalCampDN
 
Презентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury GlushkovПрезентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury Glushkov
DrupalCampDN
 
Continious integration - Иван Лещёв
Continious integration - Иван ЛещёвContinious integration - Иван Лещёв
Continious integration - Иван Лещёв
DrupalCampDN
 
Rules - Yaroslav Doroshuk
Rules - Yaroslav DoroshukRules - Yaroslav Doroshuk
Rules - Yaroslav Doroshuk
DrupalCampDN
 
Системы управления взаимоотношениями с клиентами. 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 Makhrinsky
DrupalCampDN
 
Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.
DrupalCampDN
 

Más de 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. Александр Даниленко.
 

Último

📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 

Último (20)

VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 

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