SlideShare a Scribd company logo
Moving to Drupal - Turning a Legacy Site into a CMS Site
Presented by Mark W. Jarrell                     Drupal Username: attheshow
FleetThought.com, Austin Peay State University   http://drupal.org/user/249768

August 28, 2010                                              http://fleetthought.com
What are we talking about?
✤   Two possible scenarios:

    ✤   Converting from a static non-
        database driven site

    ✤   Converting from a legacy site
        that lives in a database

✤   How to get this all moved into
    Drupal

✤   List of applications, modules,
    code, and a few tips and tricks to
    help you make the transition
    smooth
Example Scenario

✤   Legacy site w/ news stories in an Access database

✤   We want to automatically migrate these in as Drupal nodes and not pull
    them all over manually

✤   URLs look like this:
    http://www.apsu.edu/News/show_news.asp?id=4271

✤   New URLs should look like this:
    http://www.apsu.edu/news/apsu-professor-visits-israel-
    counterterrorism-fellowship
Example Scenario



✤   Also... we want users to still be able to type in the old URLs and get to
    what they're looking for. Or, if they have any of the old addresses
    bookmarked, those bookmarks should continue to work for them after the
    transition.
Why do we need to think about
this?

✤   Migration piece - you can save a
    ton of time and effort especially if
    your content is already in a
    database

✤   Redirects can make your users’
    lives easier

✤   An easier transition makes your
    project appear more successful to
    internal users.
Step 1 - Get it into MySQL

✤   Weapon of Choice: MySQL
    Migration Toolkit

✤   Download: http://
    dev.mysql.com/downloads/gui-
    tools/5.0.html

✤   Overview of using it w/
    screenshots to convert from an
    Oracle database: http://
    theopensourcery.com/
    mymigrate.htm
Step 2 - Let Drupal Know About
the New Data


✤   settings.php

✤   add in the
    new database
    connection
    string
Step 3 - Grab Your Modules

✤   Views
    http://drupal.org/project/views

✤   Schema
    http://drupal.org/project/
    schema

✤   Table Wizard
    http://drupal.org/project/tw

✤   Migrate & Migrate Extras (CCK)
    http://drupal.org/project/
    migrate
Step 4 - Pathauto (optional)


✤   If you’re using Pathauto...
    http://drupal.org/project/
    pathauto

✤   Decide how you want your URL
    paths to look early in the process

✤   Migrate module will create new
    nodes using your Pathauto
    configuration
Step 5 - Migrate the Content

✤   A) Use Table Wizard to “expose” the
    legacy table
    Makes it available to Views and Migrate
    modules.

✤   B) Add a Migrate “content set” that maps
    which data goes into which fields

✤   C) Make sure things are migrating
    correctly by doing trial runs

✤   D) May need to build a custom module to
    assist.

✤   E) Final migration
Step 5 - Migrate the Content
(con’t.)



✤   DEMO
Step 5 - Migrate the Content
(con’t.)
✤   Tips and Tricks w/ Migrate

    ✤   you can also migrate things like comments and users

    ✤   it keeps track of which legacy row became which Drupal node in a table named
        “migrate_map_[contentset]”

    ✤   It also takes a bit of extra effort and practice, but you can also make content sets
        dependent upon one another.
        Example: Import your users from the old database, then the blog posts written
        by each user, then the comments by all users that were made upon the blog
        posts by the users (maintaining all of the connections between these different
        items).

    ✤   show custom module w/ hook being used
Step 6 - Set Up Redirects
in .htaccess



✤   This file is included w/ Drupal by default, but it’s really more
    related to Apache server than to Drupal itself.

✤   Gives you lots of power to manipulate how users access your site.
Step 6 - Set Up Redirects
in .htaccess (con’t.)

✤   If doing any manual migration (we did a ton of this on the
    apsu.edu site), you can set up any general redirects in .htaccess

✤   Example:

✤   RewriteRule ^general(.*)$ /about-apsu$1 [NC,R=301,L]

✤   Redirects from:
    http://www.apsu.edu/general/mission
    to:
    http://www.apsu.edu/about-apsu/mission
Step 6 - Set Up Redirects
in .htaccess (con’t.)

✤   You can also chop off legacy file extensions in .htaccess

✤   Example:

✤   RewriteCond %{REQUEST_URI} ^(.*).aspx$
    RewriteRule ^.*$ %1 [R=301,L]

✤   Redirects from:
    http://www.apsu.edu/physics/facstaff.aspx
    to:
    http://www.apsu.edu/physics/facstaff
Step 6 - Set Up Redirects
in .htaccess (con’t.)
✤   For nodes imported via Migrate module, you can redirect in .htaccess from the
    legacy URL to the new URL

✤   Example:

✤   RewriteCond %{QUERY_STRING} ^.*id=([0-9]+).*$
    RewriteRule ^News/show_news.asp.*$ /migrate/xlat/node/%1? [NC,R=301,L]

✤   Redirects from:
    http://www.apsu.edu/News/show_news.asp?id=4271
    to:
    http://www.apsu.edu/news/apsu-professor-visits-israel-counterterrorism-
    fellowship

✤   Note: You must leave Migrate module enabled on your site for this process to
    work.
Step 6 - Set Up Redirects
in .htaccess (con’t.)


✤   Tips on redirects in .htaccess

    ✤   Look at the Apache manual page for help.
        http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

    ✤   Don’t make any changes to .htaccess without first testing it on a
        development version of the site. This is powerful stuff.
Further Reading Links


✤   Apache Manual Page on Rewrites
    http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

✤   DrupalCon D.C. Session - “Migration - Not Just For the Birds”
    http://dc2009.drupalcon.org/session/migration-not-just-birds

✤   Lullabot Article - Migration Module
    http://www.lullabot.com/articles/drupal-data-imports-migrate-and-
    table-wizard
Moving to Drupal - Turning a Legacy Site into a CMS Site
Presented by Mark W. Jarrell                     Drupal Username: attheshow
FleetThought.com, Austin Peay State University   http://drupal.org/user/249768

August 28, 2010                                              http://fleetthought.com

More Related Content

What's hot (11)

PDF
JS Chicago Meetup 2/23/16 - Redux & Routes
Nick Dreckshage
 
PDF
Anypoint Batch Processing and Polling Scope With Mulesoft
Jitendra Bafna
 
PPTX
Database change management with Liquibase
Jarosław Szczepankiewicz
 
PPTX
How to use bean as datasource in database connector
RaviRajuRamaKrishna
 
PPTX
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheel
LEDC 2016
 
PDF
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Acquia
 
PPTX
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
London Microservices
 
PPT
LiquiBase
Mike Willbanks
 
PDF
Intro to Vue
Isatu Conteh
 
PDF
Yet Another Drupal Development/Deployment Presentation
digital006
 
PDF
Nuxt.JS Introdruction
David Ličen
 
JS Chicago Meetup 2/23/16 - Redux & Routes
Nick Dreckshage
 
Anypoint Batch Processing and Polling Scope With Mulesoft
Jitendra Bafna
 
Database change management with Liquibase
Jarosław Szczepankiewicz
 
How to use bean as datasource in database connector
RaviRajuRamaKrishna
 
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheel
LEDC 2016
 
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Acquia
 
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
London Microservices
 
LiquiBase
Mike Willbanks
 
Intro to Vue
Isatu Conteh
 
Yet Another Drupal Development/Deployment Presentation
digital006
 
Nuxt.JS Introdruction
David Ličen
 

Viewers also liked (20)

PDF
Mythbusters - State Budget
Green For Kids
 
PPT
My Tundra Project Martin
Michelle McGinnis
 
PPT
Violence In Workplace
goldenrunranch
 
KEY
Web 2.0 = Accessibility 2.0?
Jared Smith
 
PPT
Cold Tundra Project Watts
Michelle McGinnis
 
PPT
Intown Community Assistance
guest8cc02
 
PPT
Itb Chap 10
Brad McCullough
 
PDF
Innerwealth Living Inspired Summary
Chris Walker
 
PPT
Test Driven Development
John Blanco
 
PPT
Presentasjon Bekas
energien
 
PPT
Untitled 2
lover 5550
 
PDF
Attracting And Retaining Excellent E Es
vickor
 
PPTX
Vaccine talk
DebbyBruck
 
PPT
The Tundra Noeth
Michelle McGinnis
 
PDF
Talent Connect Live Stream Behind the Scenes
Rob Humphrey
 
PPT
Arctic And Alpine Stinson
Michelle McGinnis
 
PPT
Ckv[1]
eline1993
 
PPT
India Presentation
gmills01
 
PPT
Lesson 9 2
ralph50
 
PDF
Falcon Stor Enables Virtual SANs For V Mware
Paul Skach
 
Mythbusters - State Budget
Green For Kids
 
My Tundra Project Martin
Michelle McGinnis
 
Violence In Workplace
goldenrunranch
 
Web 2.0 = Accessibility 2.0?
Jared Smith
 
Cold Tundra Project Watts
Michelle McGinnis
 
Intown Community Assistance
guest8cc02
 
Itb Chap 10
Brad McCullough
 
Innerwealth Living Inspired Summary
Chris Walker
 
Test Driven Development
John Blanco
 
Presentasjon Bekas
energien
 
Untitled 2
lover 5550
 
Attracting And Retaining Excellent E Es
vickor
 
Vaccine talk
DebbyBruck
 
The Tundra Noeth
Michelle McGinnis
 
Talent Connect Live Stream Behind the Scenes
Rob Humphrey
 
Arctic And Alpine Stinson
Michelle McGinnis
 
Ckv[1]
eline1993
 
India Presentation
gmills01
 
Lesson 9 2
ralph50
 
Falcon Stor Enables Virtual SANs For V Mware
Paul Skach
 
Ad

Similar to Moving to Drupal (20)

PPTX
Drupalcampchicago2010.rachel.datamigration.
Promet Source
 
PPTX
Drupal campchicago2010.rachel.datamigration
Andy Kucharski
 
PPTX
Migration from Legacy CMS to Drupal
Rachel Jaro
 
PPTX
The web is made of links. Don't break them.
Sarah Fazenbaker
 
PDF
Migrate for Site Builders from MidCamp 2016
Suzanne Dergacheva
 
PPTX
The long and the short of migrating to Drupal
jeremyfrench
 
PPT
Dcm migration
Piyuesh Kumar
 
PDF
Migrate
cherryhillco
 
PDF
Migrate all the things!
Dave Vasilevsky
 
PDF
Migrating data into Drupal using the migrate module
Johan Gant
 
PDF
SearchLeeds 2018 - Steve Chambers - Stickyeyes - How not to F**K up a Migration
Branded3
 
ODP
Migration to Drupal
Will Hall
 
PDF
My Website Is Old Enough To Vote - Kris Howard
WordCamp Sydney
 
PPTX
Best Practices and Tips on Migrating a Legacy-Based CMS to Drupal
Mediacurrent
 
PDF
Drupal migrate-june2015
Suzanne Dergacheva
 
DOC
AIESEC CMS - User guide
Bogdan Rusu
 
PDF
Intro to Drupal Migrate for Site Builders
Suzanne Dergacheva
 
PDF
My Website Can Vote - The Challenges of Maintaining a 20-year-old Website
Kristine Howard
 
PPTX
Drupal content-migration
Ashok Modi
 
PDF
How to migrate your blog from Wordpress to HubSpot
Vu Long Tran
 
Drupalcampchicago2010.rachel.datamigration.
Promet Source
 
Drupal campchicago2010.rachel.datamigration
Andy Kucharski
 
Migration from Legacy CMS to Drupal
Rachel Jaro
 
The web is made of links. Don't break them.
Sarah Fazenbaker
 
Migrate for Site Builders from MidCamp 2016
Suzanne Dergacheva
 
The long and the short of migrating to Drupal
jeremyfrench
 
Dcm migration
Piyuesh Kumar
 
Migrate
cherryhillco
 
Migrate all the things!
Dave Vasilevsky
 
Migrating data into Drupal using the migrate module
Johan Gant
 
SearchLeeds 2018 - Steve Chambers - Stickyeyes - How not to F**K up a Migration
Branded3
 
Migration to Drupal
Will Hall
 
My Website Is Old Enough To Vote - Kris Howard
WordCamp Sydney
 
Best Practices and Tips on Migrating a Legacy-Based CMS to Drupal
Mediacurrent
 
Drupal migrate-june2015
Suzanne Dergacheva
 
AIESEC CMS - User guide
Bogdan Rusu
 
Intro to Drupal Migrate for Site Builders
Suzanne Dergacheva
 
My Website Can Vote - The Challenges of Maintaining a 20-year-old Website
Kristine Howard
 
Drupal content-migration
Ashok Modi
 
How to migrate your blog from Wordpress to HubSpot
Vu Long Tran
 
Ad

More from Mark Jarrell (8)

PDF
One Man Band - Drupal Lightning Talks
Mark Jarrell
 
KEY
Building a Mobile Drupal Site
Mark Jarrell
 
PDF
APSU Drupal Training
Mark Jarrell
 
PDF
APSU Drupal Training Personal
Mark Jarrell
 
PDF
APSU Drupal Training - Personal Sites
Mark Jarrell
 
KEY
Building University Websites with the Drupal Content Management System
Mark Jarrell
 
PDF
Form Alterations
Mark Jarrell
 
PDF
Theming Your Views
Mark Jarrell
 
One Man Band - Drupal Lightning Talks
Mark Jarrell
 
Building a Mobile Drupal Site
Mark Jarrell
 
APSU Drupal Training
Mark Jarrell
 
APSU Drupal Training Personal
Mark Jarrell
 
APSU Drupal Training - Personal Sites
Mark Jarrell
 
Building University Websites with the Drupal Content Management System
Mark Jarrell
 
Form Alterations
Mark Jarrell
 
Theming Your Views
Mark Jarrell
 

Moving to Drupal

  • 1. Moving to Drupal - Turning a Legacy Site into a CMS Site Presented by Mark W. Jarrell Drupal Username: attheshow FleetThought.com, Austin Peay State University http://drupal.org/user/249768 August 28, 2010 http://fleetthought.com
  • 2. What are we talking about? ✤ Two possible scenarios: ✤ Converting from a static non- database driven site ✤ Converting from a legacy site that lives in a database ✤ How to get this all moved into Drupal ✤ List of applications, modules, code, and a few tips and tricks to help you make the transition smooth
  • 3. Example Scenario ✤ Legacy site w/ news stories in an Access database ✤ We want to automatically migrate these in as Drupal nodes and not pull them all over manually ✤ URLs look like this: http://www.apsu.edu/News/show_news.asp?id=4271 ✤ New URLs should look like this: http://www.apsu.edu/news/apsu-professor-visits-israel- counterterrorism-fellowship
  • 4. Example Scenario ✤ Also... we want users to still be able to type in the old URLs and get to what they're looking for. Or, if they have any of the old addresses bookmarked, those bookmarks should continue to work for them after the transition.
  • 5. Why do we need to think about this? ✤ Migration piece - you can save a ton of time and effort especially if your content is already in a database ✤ Redirects can make your users’ lives easier ✤ An easier transition makes your project appear more successful to internal users.
  • 6. Step 1 - Get it into MySQL ✤ Weapon of Choice: MySQL Migration Toolkit ✤ Download: http:// dev.mysql.com/downloads/gui- tools/5.0.html ✤ Overview of using it w/ screenshots to convert from an Oracle database: http:// theopensourcery.com/ mymigrate.htm
  • 7. Step 2 - Let Drupal Know About the New Data ✤ settings.php ✤ add in the new database connection string
  • 8. Step 3 - Grab Your Modules ✤ Views http://drupal.org/project/views ✤ Schema http://drupal.org/project/ schema ✤ Table Wizard http://drupal.org/project/tw ✤ Migrate & Migrate Extras (CCK) http://drupal.org/project/ migrate
  • 9. Step 4 - Pathauto (optional) ✤ If you’re using Pathauto... http://drupal.org/project/ pathauto ✤ Decide how you want your URL paths to look early in the process ✤ Migrate module will create new nodes using your Pathauto configuration
  • 10. Step 5 - Migrate the Content ✤ A) Use Table Wizard to “expose” the legacy table Makes it available to Views and Migrate modules. ✤ B) Add a Migrate “content set” that maps which data goes into which fields ✤ C) Make sure things are migrating correctly by doing trial runs ✤ D) May need to build a custom module to assist. ✤ E) Final migration
  • 11. Step 5 - Migrate the Content (con’t.) ✤ DEMO
  • 12. Step 5 - Migrate the Content (con’t.) ✤ Tips and Tricks w/ Migrate ✤ you can also migrate things like comments and users ✤ it keeps track of which legacy row became which Drupal node in a table named “migrate_map_[contentset]” ✤ It also takes a bit of extra effort and practice, but you can also make content sets dependent upon one another. Example: Import your users from the old database, then the blog posts written by each user, then the comments by all users that were made upon the blog posts by the users (maintaining all of the connections between these different items). ✤ show custom module w/ hook being used
  • 13. Step 6 - Set Up Redirects in .htaccess ✤ This file is included w/ Drupal by default, but it’s really more related to Apache server than to Drupal itself. ✤ Gives you lots of power to manipulate how users access your site.
  • 14. Step 6 - Set Up Redirects in .htaccess (con’t.) ✤ If doing any manual migration (we did a ton of this on the apsu.edu site), you can set up any general redirects in .htaccess ✤ Example: ✤ RewriteRule ^general(.*)$ /about-apsu$1 [NC,R=301,L] ✤ Redirects from: http://www.apsu.edu/general/mission to: http://www.apsu.edu/about-apsu/mission
  • 15. Step 6 - Set Up Redirects in .htaccess (con’t.) ✤ You can also chop off legacy file extensions in .htaccess ✤ Example: ✤ RewriteCond %{REQUEST_URI} ^(.*).aspx$ RewriteRule ^.*$ %1 [R=301,L] ✤ Redirects from: http://www.apsu.edu/physics/facstaff.aspx to: http://www.apsu.edu/physics/facstaff
  • 16. Step 6 - Set Up Redirects in .htaccess (con’t.) ✤ For nodes imported via Migrate module, you can redirect in .htaccess from the legacy URL to the new URL ✤ Example: ✤ RewriteCond %{QUERY_STRING} ^.*id=([0-9]+).*$ RewriteRule ^News/show_news.asp.*$ /migrate/xlat/node/%1? [NC,R=301,L] ✤ Redirects from: http://www.apsu.edu/News/show_news.asp?id=4271 to: http://www.apsu.edu/news/apsu-professor-visits-israel-counterterrorism- fellowship ✤ Note: You must leave Migrate module enabled on your site for this process to work.
  • 17. Step 6 - Set Up Redirects in .htaccess (con’t.) ✤ Tips on redirects in .htaccess ✤ Look at the Apache manual page for help. http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html ✤ Don’t make any changes to .htaccess without first testing it on a development version of the site. This is powerful stuff.
  • 18. Further Reading Links ✤ Apache Manual Page on Rewrites http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html ✤ DrupalCon D.C. Session - “Migration - Not Just For the Birds” http://dc2009.drupalcon.org/session/migration-not-just-birds ✤ Lullabot Article - Migration Module http://www.lullabot.com/articles/drupal-data-imports-migrate-and- table-wizard
  • 19. Moving to Drupal - Turning a Legacy Site into a CMS Site Presented by Mark W. Jarrell Drupal Username: attheshow FleetThought.com, Austin Peay State University http://drupal.org/user/249768 August 28, 2010 http://fleetthought.com