Shearer Software

Andrew Shearer’s Drivel

99 and 44/100 percent pure.

Tuesday, September 4, 2007

Announcing Migraine, a Drupal Site Migration Tool

Thanks to Noosphere Networks, I’m releasing a script that helps developers of web sites built with Drupal to maintain separate development/test and production sites, pushing changes from test to production as needed. This is challenging with a stock Drupal installation. Changes to PHP code are no problem, because it lives in the filesystem and can be copied or committed to a revision-control system like Subversion. But a lot of Drupal’s configuration work take place within its web administration interface and is saved to the database, where production content such as user accounts and comments is also stored.

The desire to do this frequently comes up on Drupal’s forums, and the typical workarounds have some large drawbacks (involving some combination of extended downtime on the production site, duplication of work, and the loss of content, comments, and user account changes made in the interim).

This small script attempts to solve that by categorizing Drupal’s tables and moving only the right ones at the right time, while handling details such as merging sequence numbers. It also dumps Drupal’s databases to disk in a format that works well for checkin to a revision control system.

This is free software, licensed under the GPL.

There’s a more ambitious project called AutoPilot that aims to do this and more in the future, but its ability to merge test sites into production without losing production content isn’t available yet, and I needed something now.

Be warned, though, that this is an alpha release, intended for those with familiarity with MySQL and Drupal’s table layout. If you have CCK fields, there may be some manual work required when you modify your field layout because CCK tends to change your database schema, and Migraine does not currently attempt to automate all of those changes. It will detect them and warn of the problem, however.

See more information at the Migraine project page.

   PHP, Python, Open Source, Software, General  Posted at 7:21 AM   

8 Responses to “Announcing Migraine, a Drupal Site Migration Tool”

  1. Motin Says:

    This is exactly what we were looking for!

    But how do we contribute back with categorized “unknown tables”? And eventually find other contributed categorizations?

    I’ve got the following reported as unknown currently (Mostly from E-Commerce, OpenResort and i18n):
    accommodation_availability
    accommodation_bed_types
    accommodation_inventory
    accommodation_price
    accommodation_rooms
    accommodation_types
    accommodation_units
    business
    business_ammenities
    business_ammenities_node
    business_ammenities_ptype
    business_hotel
    business_section_node_types
    business_taxes
    business_terms
    business_terms_relation
    business_terms_sections
    client
    client_system
    content_type_business
    content_type_product
    content_type_recipe
    content_type_story
    content_type_unit
    ec_address
    ec_anon
    ec_attribute
    ec_cart
    ec_coupon
    ec_credit_card
    ec_mail
    ec_paypal
    ec_product
    ec_product_attribute
    ec_product_base
    ec_product_file
    ec_product_parcel
    ec_product_tangible
    ec_recurring_expiration
    ec_recurring_product
    ec_recurring_reminder
    ec_recurring_schedule
    ec_region
    ec_region_configuration
    ec_renewal
    ec_role_discount
    ec_roles
    ec_subproduct_pricing
    ec_tax
    ec_tmp
    ec_transaction
    ec_transaction_address
    ec_transaction_coupon
    ec_transaction_misc
    ec_transaction_product
    ec_useracc
    ec_useracc_confirm
    ec_variation
    fckeditor_role
    fckeditor_settings
    i18n_blocks
    i18n_blocks_i18n
    i18n_node
    i18n_profile_fields
    i18n_variable
    location_fax
    location_phone
    menu_per_role
    recipe
    recipe_ingredient
    recipe_node_ingredient
    recipe_unit
    taxonomy_context_term
    taxonomy_context_vocabulary

    I’ll attempt to categorize these in the next few days and report back my suggestions for categorization.

    A welcomed feature would be to be able to override the tables’ categorizations in the ini-file and let the categorization in migraine.py stand as defaults only. For instance, not everyone categorizes “menu” as configuration since it may be constantly manipulated by designated moderators on the productions site etc.

    Also, this would allow easy testing of unknown tables categorization locally before attempting to commit that to your subversion repository.

  2. carolin Says:

    It’s very information and useful for migraine management.
    To complete migraine treatmeent,
    you might need to have two free bonuses of ebooks: Healing Food and Pennasia Sleep Therapy (Pleet).
    Visit at PennasiaNormalization.com for further.
    I also get two free bonuses of ebooks when I enter forum. Have a nice day!

  3. Blisstering Says:

    Thanks Andrew for the wonderful script.

    The script works for Drupal 5 but cannot be used for Drupal 6 as the database implementation has changed. The Drupal 6 version of the script can be found at http://www.blisstering.com/migraine-synchronize-your-development-staging-and-production-sites-databases-drupal-6

  4. Rich Says:

    Been trying to use Migraine, but have a few questions, coming from using the Drupal 6 version:

    I had hoped this would help me in the place I need help, getting content from the devel/staging server put on the the production server while at the same time maintaining new content that users have put on the production server.

    My situation is this: on the development site, this is when we add tons of new pages of content for users to view, for when our site goes to a new version. Also, we use different content nodes for various things, from email templates (our site sends various emails to users based on events, such as when they submit a project proposal for others to view, and they need to have translation ability) to tip and tricks, to FAQ entries, etc.

    So, I was hoping Migraine made it so these nodes mentioned aboved could be merged with user nodes, such a blog entries. Is that not the case? Can’t it export rows from the node table that match, say, type=”faq” or type=”email_template”, but leave the other types alone? Of course, this brings to question how it would handle content types made from custom modules (which mine are, such as the email templates) that have fields in their own database table as well, such as my emails having a “Subject”, “Default From”, “HTML/text” fields.

    Is this possible? I would prefer to set up all site content on the devel/staging servers, then get this, as well as settings/configuration updated on the production server. Please let me know how this can be done.

    Thanks

  5. web video production Says:

    Much prefer drupal…

  6. Oliver Says:

    Drupal is a far more sophisticated system, I have used many and found this to outway them all hands down. It is simple to use too.

  7. Money Making Tips Says:

    I tried using drupal in my previous work but I found it hard..hehe I hope i can handle doing drupal works in the future..

  8. mia Says:

    I have used both wordpress and Drupal and have found the Drupal is a much better system, if you have the time to get to grips with it.

Leave a Reply

September 2007
M T W T F S S
« Apr   Nov »
 12
3456789
10111213141516
17181920212223
24252627282930
Recent Reading

A Heartbreaking Work of Staggering Genius, by Dave Eggers

Harry Potter and the Order of the Phoenix, by J. K. Rowling

Player Piano, by Kurt Vonnegut

Bad News, by Donald E. Westlake

The Blank Slate: The Modern Denial of Human Nature, by Steven Pinker

The Jungle, by Upton Sinclair

Gödel, Escher, Bach: An Eternal Golden Braid, by Douglas R. Hofstadter

Speaking With the Angel, by Nick Hornby (Editor)

In Progress

The Language Instinct, by Steven Pinker

The Corrections, by Jonathan Franzen