Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
No Code Content Migration
Hector Iribarne @hectoriribarne
Track: Site Building
Level: Intermediate
@hectoriribarne
Hector Iribarne (iribarne.com)
Drupal Site Builder & Developer
(since 2007)
Broward Drupal co-founder
irib...
@hectoriribarne #FLDC15
Prime Focus of Presentation:
Contentin module
● The Contentin module is at the core of the “No Cod...
#FLDC15@hectoriribarne
Main Topics
Traditional Migrate module
“Code Approach”
Export Content to CSV
w/ Contentout module
N...
@hectoriribarne #FLDC15
DB
Simple CSV files
[(h)field,
(c)single-value fields]
Site 2
Contentin
Site 1
Contentout
Traditio...
Traditional
Migrate module
“Code Approach”
@hectoriribarne #FLDC15
@hectoriribarne #FLDC15
Simple CSV files
[(h)field,
(c)single-value fields]
Traditional “Code Approach” with Migrate modul...
@hectoriribarne #FLDC15
Static implementation of hook_migrate_api (migr8csv2page):
@hectoriribarne #FLDC15
Source Mapping of Migration Class (migr8csv2page):
@hectoriribarne #FLDC15
Destination Mapping of Migration Class (migr8csv2page):
Migrate
module
Demo
@hectoriribarne #FLDC15
@hectoriribarne #FLDC15
Let’s get started with setting up the traditional approach:
@hectoriribarne #FLDC15
Set-up the basics from contib for Site1:
● cd sites/all/modules
● mkdir custom
● mkdir contrib
● c...
@hectoriribarne #FLDC15
Set-up the basics for custom:
● Create a data directory under the files folder
● Place CSV files a...
@hectoriribarne #FLDC15
File Structure:
Export Content
to CSV
w/ Contentout module
@hectoriribarne #FLDC15
@hectoriribarne #FLDC15
Site 1
Contentout
Use Contentout module to create CSV:
Hierarchical CSV
files
[(h)field:subfield,
...
Contentout
Demo
@hectoriribarne #FLDC15
@hectoriribarne #FLDC15
Get the Contentout module from the Drupal sandbox:
● cd sites/all/modules/custom
● git clone --bra...
@hectoriribarne #FLDC15
Content out admin page:
@hectoriribarne #FLDC15
Content out one-click export:
No Code
Content
Migration
@hectoriribarne #FLDC15
#FLDC15
Site 2
Contentin
No Code Content Migration:
Hierarchical CSV
files
[(h)field:subfield,
(c)multi-value fields]
Two-...
Contentin
Demo
@hectoriribarne #FLDC15
@hectoriribarne #FLDC15
Set up the 2nd site for the No Code Content Migration approach:
@hectoriribarne #FLDC15
Set-up the basics from contib for Site2:
● cd sites/all/modules
● mkdir custom
● mkdir contrib
● c...
@hectoriribarne #FLDC15
Copy Content Types and Taxonomies:
● Use the Bundle Copy module to copy your content types
over fr...
@hectoriribarne #FLDC15
Get the Contentin module from the Drupal sandbox:
● cd sites/all/modules/custom
● git clone --bran...
@hectoriribarne #FLDC15
Content in admin page:
@hectoriribarne #FLDC15
Content in click to create migrations:
@hectoriribarne #FLDC15
Migrate Dashboard:
@hectoriribarne #FLDC15
Dynamically registered article content type:
@hectoriribarne #FLDC15
Dynamically registered page content type:
@hectoriribarne #FLDC15
Create Content via Migrate module (second click):
@hectoriribarne #FLDC15
Content Created!
@hectoriribarne #FLDC15
The Contentin module supported field type/widgets:
@hectoriribarne #FLDC15
Links:
● Code/files for “Traditional Approach”
○ http://browarddrupal.org/PastMeetings/march-2015
...
What Did You Think?
Please Evaluate this session at: fldrupal.
camp/conference/schedule
Questions?
Please Evaluate this session at: fldrupal.
camp/conference/schedule
http://iribarne.com/contact
If you liked my presentation, follow
me on Twitter: @hectoriribarne
Go Fish:Details:
Hector
Ir...
Upcoming SlideShare
Loading in …5
×

Drupal 7 - No code content migration

1,119 views

Published on

Migrate content in and out of Drupal 7 without having to write any code.

This was presented at Florida DrupalCamp 2015

Published in: Software
  • Be the first to comment

Drupal 7 - No code content migration

  1. 1. No Code Content Migration Hector Iribarne @hectoriribarne Track: Site Building Level: Intermediate
  2. 2. @hectoriribarne Hector Iribarne (iribarne.com) Drupal Site Builder & Developer (since 2007) Broward Drupal co-founder iribarne on Drupal.org and IRC Currently working on Contentin and Contentout (D7 sandbox modules)
  3. 3. @hectoriribarne #FLDC15 Prime Focus of Presentation: Contentin module ● The Contentin module is at the core of the “No Code Content Migration” approach for getting content into Drupal without writing any code (leverages the Migrate module) ● The module is targeted for site builders (two-click import): ○ One click to dynamically register migrations from a CSV file (Contentin module at work) ○ Second click to import registered migration (Migrate module at work) ● Contentin sandbox: https://www.drupal.org/sandbox/iribarne/2461615 ○ git clone --branch 7.x-1.x http://git.drupal.org/sandbox/iribarne/2461615.git contentin
  4. 4. #FLDC15@hectoriribarne Main Topics Traditional Migrate module “Code Approach” Export Content to CSV w/ Contentout module No Code Content Migration w/ Contentin module
  5. 5. @hectoriribarne #FLDC15 DB Simple CSV files [(h)field, (c)single-value fields] Site 2 Contentin Site 1 Contentout Traditional “Code Approach”: No Code Content Migration: Migrate Code (not covered) Migrate Code Hierarchical CSV files [(h)field:subfield, (c)multi-value fields] One-click Two-clicks migr8csv2article migr8csv2page 1 2 3 h c c c h c c c Legend: (h) header (c) content
  6. 6. Traditional Migrate module “Code Approach” @hectoriribarne #FLDC15
  7. 7. @hectoriribarne #FLDC15 Simple CSV files [(h)field, (c)single-value fields] Traditional “Code Approach” with Migrate module: Migrate Code migr8csv2article migr8csv2page 1 h c c c Legend: (h) header (c) content Site 1
  8. 8. @hectoriribarne #FLDC15 Static implementation of hook_migrate_api (migr8csv2page):
  9. 9. @hectoriribarne #FLDC15 Source Mapping of Migration Class (migr8csv2page):
  10. 10. @hectoriribarne #FLDC15 Destination Mapping of Migration Class (migr8csv2page):
  11. 11. Migrate module Demo @hectoriribarne #FLDC15
  12. 12. @hectoriribarne #FLDC15 Let’s get started with setting up the traditional approach:
  13. 13. @hectoriribarne #FLDC15 Set-up the basics from contib for Site1: ● cd sites/all/modules ● mkdir custom ● mkdir contrib ● cd contrib ● drush dl module_filter admin_menu migrate bundle_copy taxonomy_csv devel;drush en -y module_filter admin_menu migrate migrate_ui bundle_copy taxonomy_csv;drush dis -y overlay toolbar
  14. 14. @hectoriribarne #FLDC15 Set-up the basics for custom: ● Create a data directory under the files folder ● Place CSV files article.csv and page.csv in the sites/all/default/files/data directory ● Place custom modules migr8csv2article and migr8csv2page in the sites/all/modules/custom directory and enable the modules
  15. 15. @hectoriribarne #FLDC15 File Structure:
  16. 16. Export Content to CSV w/ Contentout module @hectoriribarne #FLDC15
  17. 17. @hectoriribarne #FLDC15 Site 1 Contentout Use Contentout module to create CSV: Hierarchical CSV files [(h)field:subfield, (c)multi-value fields] One-click 2 h c c c Legend: (h) header (c) content
  18. 18. Contentout Demo @hectoriribarne #FLDC15
  19. 19. @hectoriribarne #FLDC15 Get the Contentout module from the Drupal sandbox: ● cd sites/all/modules/custom ● git clone --branch 7.x-1.x http://git.drupal. org/sandbox/iribarne/2461613.git contentout ● Enable the Contentout module ● Go to Contentout on the admin menu: Configuration -> Content authoring -> Content automation -> Content out
  20. 20. @hectoriribarne #FLDC15 Content out admin page:
  21. 21. @hectoriribarne #FLDC15 Content out one-click export:
  22. 22. No Code Content Migration @hectoriribarne #FLDC15
  23. 23. #FLDC15 Site 2 Contentin No Code Content Migration: Hierarchical CSV files [(h)field:subfield, (c)multi-value fields] Two-clicks 3 h c c c Legend: (h) header (c) content
  24. 24. Contentin Demo @hectoriribarne #FLDC15
  25. 25. @hectoriribarne #FLDC15 Set up the 2nd site for the No Code Content Migration approach:
  26. 26. @hectoriribarne #FLDC15 Set-up the basics from contib for Site2: ● cd sites/all/modules ● mkdir custom ● mkdir contrib ● cd contrib ● drush dl module_filter admin_menu migrate bundle_copy taxonomy_csv devel;drush en -y module_filter admin_menu migrate migrate_ui bundle_copy taxonomy_csv;drush dis -y overlay toolbar
  27. 27. @hectoriribarne #FLDC15 Copy Content Types and Taxonomies: ● Use the Bundle Copy module to copy your content types over from Site1 to Site2 ● Use the Taxonomy CSV module to copy your taxonomies over from Site1 to Site2
  28. 28. @hectoriribarne #FLDC15 Get the Contentin module from the Drupal sandbox: ● cd sites/all/modules/custom ● git clone --branch 7.x-1.x http://git.drupal. org/sandbox/iribarne/2461615.git contentin ● Enable the Contentin module ● Go to Contentout on the admin menu: Configuration -> Content authoring -> Content automation -> Content in
  29. 29. @hectoriribarne #FLDC15 Content in admin page:
  30. 30. @hectoriribarne #FLDC15 Content in click to create migrations:
  31. 31. @hectoriribarne #FLDC15 Migrate Dashboard:
  32. 32. @hectoriribarne #FLDC15 Dynamically registered article content type:
  33. 33. @hectoriribarne #FLDC15 Dynamically registered page content type:
  34. 34. @hectoriribarne #FLDC15 Create Content via Migrate module (second click):
  35. 35. @hectoriribarne #FLDC15 Content Created!
  36. 36. @hectoriribarne #FLDC15 The Contentin module supported field type/widgets:
  37. 37. @hectoriribarne #FLDC15 Links: ● Code/files for “Traditional Approach” ○ http://browarddrupal.org/PastMeetings/march-2015 ● Contentout sandbox module ○ https://www.drupal.org/sandbox/iribarne/2461613 ● Code for Contentout sandbox module ○ git clone --branch 7.x-1.x http://git.drupal.org/sandbox/iribarne/2461613.git contentout ● Contentin sandbox module ○ https://www.drupal.org/sandbox/iribarne/2461615 ● Code for Contentin sandbox module ○ git clone --branch 7.x-1.x http://git.drupal.org/sandbox/iribarne/2461615.git contentin
  38. 38. What Did You Think? Please Evaluate this session at: fldrupal. camp/conference/schedule
  39. 39. Questions? Please Evaluate this session at: fldrupal. camp/conference/schedule
  40. 40. http://iribarne.com/contact If you liked my presentation, follow me on Twitter: @hectoriribarne Go Fish:Details: Hector Iribarne d.o. username: iribarne http://certifiedtorock.com/u/192646

×