SlideShare una empresa de Scribd logo
1 de 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
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

Más contenido relacionado

La actualidad más candente

Building a Single Page Application with VueJS
Building a Single Page Application with VueJSBuilding a Single Page Application with VueJS
Building a Single Page Application with VueJSdanpastori
 
JS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesJS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesNick Dreckshage
 
Anypoint Batch Processing and Polling Scope With Mulesoft
Anypoint Batch Processing and Polling Scope With MulesoftAnypoint Batch Processing and Polling Scope With Mulesoft
Anypoint Batch Processing and Polling Scope With MulesoftJitendra Bafna
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connectorRaviRajuRamaKrishna
 
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheel
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheelАртем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheel
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheelLEDC 2016
 
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best PracticesCaching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best PracticesAcquia
 
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...London Microservices
 
Yet Another Drupal Development/Deployment Presentation
Yet Another Drupal Development/Deployment PresentationYet Another Drupal Development/Deployment Presentation
Yet Another Drupal Development/Deployment Presentationdigital006
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS IntrodructionDavid Ličen
 

La actualidad más candente (12)

Building a Single Page Application with VueJS
Building a Single Page Application with VueJSBuilding a Single Page Application with VueJS
Building a Single Page Application with VueJS
 
JS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesJS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & Routes
 
Anypoint Batch Processing and Polling Scope With Mulesoft
Anypoint Batch Processing and Polling Scope With MulesoftAnypoint Batch Processing and Polling Scope With Mulesoft
Anypoint Batch Processing and Polling Scope With Mulesoft
 
Database change management with Liquibase
Database change management with LiquibaseDatabase change management with Liquibase
Database change management with Liquibase
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connector
 
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheel
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheelАртем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheel
Артем Сильчук - Respond in 60ms. Extremal optimization with reinventing a wheel
 
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best PracticesCaching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
 
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
 
LiquiBase
LiquiBaseLiquiBase
LiquiBase
 
Intro to Vue
Intro to Vue Intro to Vue
Intro to Vue
 
Yet Another Drupal Development/Deployment Presentation
Yet Another Drupal Development/Deployment PresentationYet Another Drupal Development/Deployment Presentation
Yet Another Drupal Development/Deployment Presentation
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
 

Destacado

Mythbusters - State Budget
Mythbusters - State BudgetMythbusters - State Budget
Mythbusters - State BudgetGreen For Kids
 
Web 2.0 = Accessibility 2.0?
Web 2.0 = Accessibility 2.0?Web 2.0 = Accessibility 2.0?
Web 2.0 = Accessibility 2.0?Jared Smith
 
Intown Community Assistance
Intown Community AssistanceIntown Community Assistance
Intown Community Assistanceguest8cc02
 
Innerwealth Living Inspired Summary
Innerwealth Living Inspired SummaryInnerwealth Living Inspired Summary
Innerwealth Living Inspired SummaryChris Walker
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentJohn Blanco
 
Presentasjon Bekas
Presentasjon BekasPresentasjon Bekas
Presentasjon Bekasenergien
 
Attracting And Retaining Excellent E Es
Attracting And Retaining Excellent E EsAttracting And Retaining Excellent E Es
Attracting And Retaining Excellent E Esvickor
 
Talent Connect Live Stream Behind the Scenes
Talent Connect Live Stream Behind the ScenesTalent Connect Live Stream Behind the Scenes
Talent Connect Live Stream Behind the ScenesRob Humphrey
 
India Presentation
India PresentationIndia Presentation
India Presentationgmills01
 
Lesson 9 2
Lesson 9 2Lesson 9 2
Lesson 9 2ralph50
 
Falcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V MwareFalcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V MwarePaul Skach
 

Destacado (20)

Mythbusters - State Budget
Mythbusters - State BudgetMythbusters - State Budget
Mythbusters - State Budget
 
My Tundra Project Martin
My Tundra Project MartinMy Tundra Project Martin
My Tundra Project Martin
 
Violence In Workplace
Violence In WorkplaceViolence In Workplace
Violence In Workplace
 
Web 2.0 = Accessibility 2.0?
Web 2.0 = Accessibility 2.0?Web 2.0 = Accessibility 2.0?
Web 2.0 = Accessibility 2.0?
 
Cold Tundra Project Watts
Cold Tundra Project WattsCold Tundra Project Watts
Cold Tundra Project Watts
 
Intown Community Assistance
Intown Community AssistanceIntown Community Assistance
Intown Community Assistance
 
Itb Chap 10
Itb Chap 10Itb Chap 10
Itb Chap 10
 
Innerwealth Living Inspired Summary
Innerwealth Living Inspired SummaryInnerwealth Living Inspired Summary
Innerwealth Living Inspired Summary
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Presentasjon Bekas
Presentasjon BekasPresentasjon Bekas
Presentasjon Bekas
 
Untitled 2
Untitled 2Untitled 2
Untitled 2
 
Attracting And Retaining Excellent E Es
Attracting And Retaining Excellent E EsAttracting And Retaining Excellent E Es
Attracting And Retaining Excellent E Es
 
Vaccine talk
Vaccine talkVaccine talk
Vaccine talk
 
The Tundra Noeth
The Tundra NoethThe Tundra Noeth
The Tundra Noeth
 
Talent Connect Live Stream Behind the Scenes
Talent Connect Live Stream Behind the ScenesTalent Connect Live Stream Behind the Scenes
Talent Connect Live Stream Behind the Scenes
 
Arctic And Alpine Stinson
Arctic And Alpine StinsonArctic And Alpine Stinson
Arctic And Alpine Stinson
 
Ckv[1]
Ckv[1]Ckv[1]
Ckv[1]
 
India Presentation
India PresentationIndia Presentation
India Presentation
 
Lesson 9 2
Lesson 9 2Lesson 9 2
Lesson 9 2
 
Falcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V MwareFalcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V Mware
 

Similar a Moving to Drupal

Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Phase2
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedAndy Kucharski
 
Drupal Checklist for Site Builder and Web admin
Drupal Checklist for Site Builder and Web adminDrupal Checklist for Site Builder and Web admin
Drupal Checklist for Site Builder and Web adminAdolfo Nasol
 
Drupalcampchicago2010.rachel.datamigration.
Drupalcampchicago2010.rachel.datamigration.Drupalcampchicago2010.rachel.datamigration.
Drupalcampchicago2010.rachel.datamigration.Promet Source
 
Drupal Migrations in 2018
Drupal Migrations in 2018Drupal Migrations in 2018
Drupal Migrations in 2018Pantheon
 
Getting started with hot towel spa
Getting started with hot towel spaGetting started with hot towel spa
Getting started with hot towel spaparth17290
 
Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018Bastian Grimm
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Drupal migrations in 2018 - SFDUG, March 8, 2018
Drupal migrations in 2018 - SFDUG, March 8, 2018Drupal migrations in 2018 - SFDUG, March 8, 2018
Drupal migrations in 2018 - SFDUG, March 8, 2018Irina Zaks
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingAshok Modi
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiGirish Kalamati
 
Drupal 6 Performance Tips
Drupal 6 Performance TipsDrupal 6 Performance Tips
Drupal 6 Performance TipsTrevor James
 
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in NashvilleDrupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in NashvilleIrina Zaks
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101Angus Li
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedPromet Source
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xWong Hoi Sing Edison
 
Performance Optimization in Drupal 8
Performance Optimization in Drupal 8Performance Optimization in Drupal 8
Performance Optimization in Drupal 8valuebound
 

Similar a Moving to Drupal (20)

Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Drupal Checklist for Site Builder and Web admin
Drupal Checklist for Site Builder and Web adminDrupal Checklist for Site Builder and Web admin
Drupal Checklist for Site Builder and Web admin
 
Drupalcampchicago2010.rachel.datamigration.
Drupalcampchicago2010.rachel.datamigration.Drupalcampchicago2010.rachel.datamigration.
Drupalcampchicago2010.rachel.datamigration.
 
Drupal Migrations in 2018
Drupal Migrations in 2018Drupal Migrations in 2018
Drupal Migrations in 2018
 
Getting started with hot towel spa
Getting started with hot towel spaGetting started with hot towel spa
Getting started with hot towel spa
 
Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018Migration Best Practices - SEOkomm 2018
Migration Best Practices - SEOkomm 2018
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Drupal migrations in 2018 - SFDUG, March 8, 2018
Drupal migrations in 2018 - SFDUG, March 8, 2018Drupal migrations in 2018 - SFDUG, March 8, 2018
Drupal migrations in 2018 - SFDUG, March 8, 2018
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish Kalamati
 
Nuxtjs cheat-sheet
Nuxtjs cheat-sheetNuxtjs cheat-sheet
Nuxtjs cheat-sheet
 
Drupal 6 Performance Tips
Drupal 6 Performance TipsDrupal 6 Performance Tips
Drupal 6 Performance Tips
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
 
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in NashvilleDrupal migrations in 2018 - presentation at DrupalCon in Nashville
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
Performance Optimization in Drupal 8
Performance Optimization in Drupal 8Performance Optimization in Drupal 8
Performance Optimization in Drupal 8
 

Más de Mark Jarrell

One Man Band - Drupal Lightning Talks
One Man Band - Drupal Lightning TalksOne Man Band - Drupal Lightning Talks
One Man Band - Drupal Lightning TalksMark Jarrell
 
Building a Mobile Drupal Site
Building a Mobile Drupal SiteBuilding a Mobile Drupal Site
Building a Mobile Drupal SiteMark Jarrell
 
APSU Drupal Training
APSU Drupal TrainingAPSU Drupal Training
APSU Drupal TrainingMark Jarrell
 
APSU Drupal Training Personal
APSU Drupal Training PersonalAPSU Drupal Training Personal
APSU Drupal Training PersonalMark Jarrell
 
APSU Drupal Training - Personal Sites
APSU Drupal Training - Personal SitesAPSU Drupal Training - Personal Sites
APSU Drupal Training - Personal SitesMark Jarrell
 
Building University Websites with the Drupal Content Management System
Building University Websites with the Drupal Content Management SystemBuilding University Websites with the Drupal Content Management System
Building University Websites with the Drupal Content Management SystemMark Jarrell
 
Theming Your Views
Theming Your ViewsTheming Your Views
Theming Your ViewsMark Jarrell
 

Más de Mark Jarrell (8)

One Man Band - Drupal Lightning Talks
One Man Band - Drupal Lightning TalksOne Man Band - Drupal Lightning Talks
One Man Band - Drupal Lightning Talks
 
Building a Mobile Drupal Site
Building a Mobile Drupal SiteBuilding a Mobile Drupal Site
Building a Mobile Drupal Site
 
APSU Drupal Training
APSU Drupal TrainingAPSU Drupal Training
APSU Drupal Training
 
APSU Drupal Training Personal
APSU Drupal Training PersonalAPSU Drupal Training Personal
APSU Drupal Training Personal
 
APSU Drupal Training - Personal Sites
APSU Drupal Training - Personal SitesAPSU Drupal Training - Personal Sites
APSU Drupal Training - Personal Sites
 
Building University Websites with the Drupal Content Management System
Building University Websites with the Drupal Content Management SystemBuilding University Websites with the Drupal Content Management System
Building University Websites with the Drupal Content Management System
 
Form Alterations
Form AlterationsForm Alterations
Form Alterations
 
Theming Your Views
Theming Your ViewsTheming Your Views
Theming Your Views
 

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

Notas del editor