Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to Migrate Legacy Content to Craft Without Losing Your Sanity

James Greig
September 28, 2018

How to Migrate Legacy Content to Craft Without Losing Your Sanity

Importing existing content from another CMS is often a crucial step in a Craft project, but it can be a painful process.

What’s the best way to shape the content before you migrate it? What tools can you use to make the job easier? And what should you do if you get stuck?

This talk will help you to create a content migration workflow that makes sense for your needs and skillsets, and avoid some of the common pitfalls of content migration.

We’ll also explore methods for automagically importing content from the likes of Airtable via their API.

James Greig

September 28, 2018
Tweet

Other Decks in Programming

Transcript

  1. !1
    @graphicalhouse

    View Slide

  2. Legacy

    CMS

    View Slide

  3. Custom















    CMS


    View Slide

  4. ‣Old/unruly technology
    ‣Broken images
    ‣Weird text formatting
    ‣Misformed URLs
    ‣Frustrated clients
    ‣Shonky SEO

    View Slide

  5. Like moving to a new house, except
    it takes longer, it’s more emotional,
    and it’s a lot more expensive...
    SETH GODIN ON
    MOVING FROM TYPEPAD
    TO WORDPRESS

    View Slide

  6. How to Migrate

    Legacy Content
    to Craft CMS WITHOUT
    LOSING
    YOUR
    SANITY
    @j_greig
    greig.cc

    View Slide

  7. ich bin
    nicht super
    technisch

    View Slide

  8. Designer Developer
    Content
    Strategist
    Information
    Architect

    View Slide

  9. Designer Developer
    Content
    Strategist
    Information
    Architect
    “I make
    websites”

    View Slide

  10. Contribute
    2002–2003
    Flash
    2003–2006
    Wordpress
    2006-2016
    Wordpress
    2006–2014 2014–17
    Craft :)
    2017–
    Squarespace
    Shopify
    Jekyll
    Macromedia
    Anything…
    Help me!

    View Slide

  11. OBLIGATORY CAT PHOTO

    View Slide

  12. Done right,
    website migrations
    are like cooking
    a good stir-fry
    Lernert & Sander

    View Slide

  13. STIR FRY
    Choose recipe
    Assemble ingredients
    Chop ingredients
    Cook!
    (And enjoy)
    CONTENT MIGRATION
    Choose recipe
    Assemble content
    Chop content
    Migrate!
    (And enjoy)

    View Slide

  14. Choose recipe
    Assemble ingredients
    Chop ingredients
    Cook!
    (And enjoy)
    Choose recipe
    Assemble content
    Chop content
    Migrate!
    (And enjoy)
    THE HARD PART
    THE RELATIVELY EASY PART
    STIR FRY CONTENT MIGRATION

    View Slide

  15. trends.builtwith.com/cms/Craft/Market-Share
    Where

    from?

    View Slide

  16. Connect to external MySQL/Postgres
    databases and manipulate them in Twig.
    Connect
    Use the Guzzle HTTP client in Craft
    templates (handy for APIs).
    Fetch
    Import content and settings. Generate
    fake data (and remove it when done).
    Sprout Import
    XML/RSS/CSV/JSON to entries,
    categories, products and more.
    Feed Me (Pro)
    Use GatherContent to collect and
    organise your website content.
    GatherContent
    Some handy plugins
    for content migrations
    IMPORTING CONTENT CONTROL PANEL
    Inspect field handles and quickly edit
    field settings. (Must have!)
    CP Field Inspect
    Create plain text fields that are
    disabled, hidden or read-only.
    Incognito Field
    Edit multiple things (entries, assets,
    categories) without going back & forth
    Sequential Edit
    Quicker management and replication of
    fields and field groups.
    Field Manager
    MOVING CONTENT
    Quickly create migrations for settings
    (fields/sections/sites) and content.
    Migration Manager
    Generate content models from
    JSON data.
    Architect
    OTHER
    Intelligently redirect legacy URLs.
    Retour
    Integrates the Disqus commenting
    system into Craft 3 websites.
    Disqus
    Seamless legacy authentication -
    import WP/EE/BC users and more.
    Legacy Login
    *
    * these are all links

    View Slide

  17. THREE
    MIGRATION
    STORIES

    View Slide

  18. WORDPRESS
    MIGRATION
    STORY 1

    View Slide

  19. UGH

    View Slide

  20. Start with a

    site audit ‣ Structure
    ‣ Content
    ‣ Functionality
    TIP

    View Slide

  21. EXPORT USING
    WP ALL EXPORT

    View Slide

  22. POSTS XML

    View Slide

  23. FEED ME SETUP

    View Slide

  24. END RESULT =
    ENTRIES IN CRAFT

    View Slide

  25. Don’t forget to
    import existing
    CMS admins
    TIP
    Legacy Login
    Top Shelf Craft
    Migrate users from:
    ExpressionEngine 2.x
    WordPress
    BigCommerce (self-hosted)
    Wellspring

    View Slide

  26. Comments can
    be migrated too
    TIP
    Craft Disqus
    nystudio107
    Integrates the Disqus commenting system
    into Craft 3 websites, including Single Sign
    On and custom login/logout URLs.

    View Slide

  27. CUSTOM CMS

    MIGRATION
    @joselong
    STORY 2

    View Slide

  28. 1. LEGACY CMS WITH POSTGRES DATABASE
    2. CRAFT CONNECT PLUGIN
    Connect to external mysql/psql databases, then
    perform db queries in your Craft Twig templates
    3. JSON FEED OF ENTRIES
    4. FEED ME PLUGIN
    5. HAPPINESS

    View Slide

  29. Don't be
    a hero!
    (sometimes it's faster
    to do it manually)
    TIP

    View Slide

  30. Chop off
    what you
    don't need
    TIP
    FOR EXAMPLE: CMS-GENERATED

    IMAGE VARIATIONS IN S3 BUCKET

    View Slide

  31. Can't make it work
    exactly how you want?
    Use a simpler template
    for legacy content.
    TIP

    View Slide

  32. LEGACY TEMPLATE
    A single rich-text field,
    and a single assets field

    View Slide

  33. LEGACY TEMPLATE
    A single rich-text field,
    and a single assets field
    NEW TEMPLATE
    Matrix field with content blocks

    View Slide

  34. Don’t miss the
    opportunity to
    improve SEO
    TIP
    dotall.com/sessions/seo-best-practices-from-a-developers-point-of-view

    View Slide

  35. HANDS-FREE

    MIGRATION
    STORY 3

    View Slide

  36. HANDS-FREE

    MIGRATION
    STORY 3

    View Slide

  37. Don't have
    access to the
    current
    CMS? Use a
    scraping tool.
    TIP

    View Slide

  38. Don't have
    access to the
    current
    CMS? Use a
    scraping tool.
    TIP

    View Slide

  39. View Slide

  40. View Slide

  41. 2. JSON FEED
    1. PARSEHUB SCRAPE 3. FEED ME PLUGIN
    4. EVEN HAPPIER LAGER

    View Slide

  42. Now for
    something
    “fun”

    View Slide

  43. Now for
    something
    “fun”
    Twitter Airtable JSON Craft
    ZAPIER .SH SCRIPT
    & CRONJOB
    FEED ME

    View Slide

  44. Twitter → Zapier → Airtable → JSON → Feed Me → Craft
    Give me some #dotall2018 tweets
    (with emoji plz )

    View Slide

  45. Twitter → Zapier → Airtable → JSON → Feed Me → Craft

    View Slide

  46. https://airtable.com/invite/r/cvOfNOTz
    Twitter → Zapier → Airtable → JSON → Feed Me → Craft
    Not bad...

    View Slide

  47. Twitter → Zapier → Airtable → JSON → Feed Me → Craft
    Better :)

    View Slide

  48. Twitter → Zapier → Airtable → JSON → Feed Me → Craft
    Better :)

    View Slide

  49. getpostman.com
    Twitter → Zapier → Airtable → JSON → Feed Me → Craft

    View Slide

  50. getpostman.com
    v
    SHELL SCRIPT TO CREATE JSON VIA AIRTABLE API

    View Slide

  51. Twitter → Zapier → Airtable → JSON → Feed Me → Craft

    View Slide

  52. Twitter → Zapier → Airtable → JSON → Feed Me → Craft
    SHELL SCRIPT TO CREATE JSON VIA AIRTABLE API & RUN FEEDME

    View Slide

  53. Twitter → Zapier → Airtable → JSON → Feed Me → Craft
    CRON JOB RUNNING EVERY MINUTE ON SERVER TO TRIGGER SHELL SCRIPT

    View Slide

  54. Twitter → Zapier → Airtable → JSON → Feed Me → Craft

    View Slide

  55. Twitter → Zapier → Airtable → JSON → Feed Me → Craft
    INVITE PEOPLE TO
    TWEET WITH
    #DOTALL2018 AT THIS
    POINT
    TODO: FRONTEND
    TEMPLATE WITH AJAX
    AUTO-LOADING

    (IF TIME!)

    View Slide

  56. Airtable JSON Craft
    AIRTABLE
    API
    FEED ME
    BUT HOW
    COULD YOU
    USE THIS IN
    REAL LIFE?

    View Slide

  57. Airtable JSON
    AIRTABLE
    API
    BUT HOW
    COULD YOU
    USE THIS IN
    REAL LIFE?

    View Slide

  58. Airtable JSON Craft
    AIRTABLE
    API
    FEED ME
    BUT HOW
    COULD YOU
    USE THIS IN
    REAL LIFE?

    View Slide

  59. Content
    migrations

    don’t have to

    be a PITA.

    View Slide

  60. 1. A good content migration is like

    cooking a stir fry
    2. Start with a site audit.
    3. Not just about core content,

    users and comments can come too.
    4. Don’t be a hero!

    (Do it manually if you have to)
    5. Chop off what you don’t need.
    6. If you get stuck, use a simpler

    template for legacy content.
    7. Use a scraping tool if you don’t

    have access to the current CMS.
    8. Improve SEO whilst you go.
    Content
    migrations

    don’t have to

    be a PITA.

    View Slide

  61. Content
    migrations

    don’t have to

    be a PITA.
    Have fun,

    and embrace

    the learning
    opportunity.

    View Slide

  62. Least-worst CMS

    View Slide

  63. Thank y all
    @j_greig
    greig.cc
    @graphicalhouse
    graphicalhouse.co.uk

    View Slide