Moving to Drupal


Published on

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

  • Moving to Drupal

    1. 1. Moving to Drupal - Turning a Legacy Site into a CMS Site Presented by Mark W. Jarrell Drupal Username: attheshow, Austin Peay State University August 28, 2010
    2. 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. 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: ✤ New URLs should look like this: counterterrorism-fellowship
    4. 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. 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. 6. Step 1 - Get it into MySQL ✤ Weapon of Choice: MySQL Migration Toolkit ✤ Download: http:// tools/5.0.html ✤ Overview of using it w/ screenshots to convert from an Oracle database: http:// mymigrate.htm
    7. 7. Step 2 - Let Drupal Know About the New Data ✤ settings.php ✤ add in the new database connection string
    8. 8. Step 3 - Grab Your Modules ✤ Views ✤ Schema schema ✤ Table Wizard ✤ Migrate & Migrate Extras (CCK) migrate
    9. 9. Step 4 - Pathauto (optional) ✤ If you’re using Pathauto... 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. 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. 11. Step 5 - Migrate the Content (con’t.) ✤ DEMO
    12. 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. 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. 14. Step 6 - Set Up Redirects in .htaccess (con’t.) ✤ If doing any manual migration (we did a ton of this on the site), you can set up any general redirects in .htaccess ✤ Example: ✤ RewriteRule ^general(.*)$ /about-apsu$1 [NC,R=301,L] ✤ Redirects from: to:
    15. 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: to:
    16. 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: to: fellowship ✤ Note: You must leave Migrate module enabled on your site for this process to work.
    17. 17. Step 6 - Set Up Redirects in .htaccess (con’t.) ✤ Tips on redirects in .htaccess ✤ Look at the Apache manual page for help. ✤ Don’t make any changes to .htaccess without first testing it on a development version of the site. This is powerful stuff.
    18. 18. Further Reading Links ✤ Apache Manual Page on Rewrites ✤ DrupalCon D.C. Session - “Migration - Not Just For the Birds” ✤ Lullabot Article - Migration Module table-wizard
    19. 19. Moving to Drupal - Turning a Legacy Site into a CMS Site Presented by Mark W. Jarrell Drupal Username: attheshow, Austin Peay State University August 28, 2010