Unveiling Design Patterns: A Visual Guide with UML Diagrams
Drupal 7 - No code content migration
1. No Code Content Migration
Hector Iribarne @hectoriribarne
Track: Site Building
Level: Intermediate
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. @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
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
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
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. @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
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
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
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
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. @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. @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
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