23
Content Migration: CSV to Drupal 8 Hector Iribarne @hectoriribarne Track: Development & Performance Level: Intermediate

Content migration - CSV to Drupal 8

Embed Size (px)

Citation preview

Page 1: Content migration -  CSV to Drupal 8

Content Migration: CSV to Drupal 8

Hector Iribarne @hectoriribarneTrack: Development & Performance

Level: Intermediate

Page 2: Content migration -  CSV to Drupal 8

@hectoriribarne

Hector Iribarne (iribarne.com)

Drupal Site Builder & Developer (since 2007)

Broward Drupal co-founder

iribarne on Drupal.org and IRC

Contributed Contentin and Contentout modules (D7 sandbox modules)

#FLDC16

Page 3: Content migration -  CSV to Drupal 8

#FLDC16@hectoriribarne

Main Topics Demo migrating content into D8 from a CSV file

Demo migrating users into D8 from a CSV file

Let’s look at some D8 code!

Page 4: Content migration -  CSV to Drupal 8

Basics:

Migrating Content CSV into Drupal 8

@hectoriribarne #FLDC16

Page 5: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Drupal 8 - Migrating from a CSV source - Basics :

● Drupal 8 contrib migrate modules:○ Migrate Plus ○ Migrate Tools○ Migrate Source CSV

● Great example (reference for this presentation) on migrating content into Drupal 8 from Lucas Hedding, the maintainer of the Migrate Source CSV module: https://github.com/heddn/d8_custom_migrate

Page 6: Content migration -  CSV to Drupal 8

@hectoriribarne

DB from Site 1(D7)

CSV file (users)[(h)header,(c)content]

Site 2(D8)

Site 1(D7)

CSV to Drupal 8 Content/User Migration:

Contentout(One-click to

generate CSV file from Site 1)

d8_migr8_csv2pages

1

2

Legend:(h) header(c) contentSandbox moduleCustom modules Demo number

#FLDC16

Presentation in one slide 1

hccc

CSV file (pages)[(h)header,(c)content]

hccc

migr8_users

SQL query(generate CSV file

from Site 1 DB)

SELECT FROMWHERE

Page 7: Content migration -  CSV to Drupal 8

Demo 1:

CSV content

into D8

@hectoriribarne #FLDC16

Page 8: Content migration -  CSV to Drupal 8

Demo 2:

CSV users

into D8

@hectoriribarne #FLDC16

Page 9: Content migration -  CSV to Drupal 8

What we covered in

both demos

@hectoriribarne #FLDC16

Page 10: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Drupal 7 content to export:

Page 11: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Create CSV file in Drupal 7 using Contentout:

Page 12: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Pages.csv file:

Page 13: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Import CSV content into Drupal 8:

Page 14: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Voila! Content migrated to D8:

Page 15: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Drupal 7 users to export:

Page 16: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

SQL query for users:

Page 17: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

qb_users.csv file:

Page 18: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Import CSV users into Drupal 8:

Page 19: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Voila! Users migrated to D8:

Page 20: Content migration -  CSV to Drupal 8

Let’s look at some code!!!

@hectoriribarne #FLDC16

Page 21: Content migration -  CSV to Drupal 8

@hectoriribarne #FLDC16

Links:

● Code/files: CSV to D8 Migration○ http://browarddrupal.org/PastMeetings/february-2016

● Contentout sandbox module○ https://www.drupal.org/sandbox/iribarne/2461613

○ git clone --branch 7.x-1.x http://git.drupal.org/sandbox/iribarne/2461613.git contentout

● Content Migration: CSV to Drupal 7○ http://www.slideshare.net/hectoriribarne/drupal-camp-atlanta-2015-no-code-content-

migration

Page 22: Content migration -  CSV to Drupal 8

Questions?

Hector Iribarne @hectoriribarne

Page 23: Content migration -  CSV to Drupal 8

http://browarddrupal.org/contact

If you liked my presentation, follow me on Twitter: @hectoriribarne

Go Fish:Details:

HectorIribarne

d.o. username: iribarne

http://certifiedtorock.com/u/192646

#FLDC16