Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Squarespace → Drupala migration adventure
Joe Chellmanshooflydesign.org
@shooflydesign
Quick Thanks:Joseph Linaschke
ApertureExpert.comPhotoJoseph.com
On the menu
• Intro to Squarespace
• Intro to Migrate module
• Great gnashing of teeth in the face of the exported data
• Intro to our friends XMLstarlet and BBEdit shell worksheets
• Code overview
• Running the migration via drush
drupal.org/project/migratewww.acquia.com/blog/migrate-26-framework-changes
Migrate module
DATA
An XPath to remember
• User Accounts:/squarespace-‐wireframe/website-‐member-‐accounts/website-‐member-‐account
• Blog posts:/squarespace-‐wireframe/sections/section/modules/module[id='000']/content/journal-‐entry
• Blog comments:/squarespace-‐wireframe/sections/section/modules/module[id='000']/content/
journal-‐entry-‐comment
/squarespace-‐wireframe/sections/section/modules/module[id='000']/content/comment
• Blog followups:/squarespace-‐wireframe/sections/section/modules/module[id='000']/content/ journal-‐entry[boolean(parent-‐id)]
• Forum posts and comments:/squarespace-‐wireframe/sections/section/modules/module/modules/module/content/
discussion-‐post[not (parent-‐id)]
/squarespace-‐wireframe/sections/section/modules/module/modules/module/content/
discussion-‐post[boolean(parent-‐id)]
• Forum posts and comments content (?!):/squarespace-‐wireframe/sections/section/modules/module/modules/module/content/comment
xmlstar.sourceforge.netbarebones.com/bbedit
Help from our friends:XMLstarlet + BBEdit
CODE!(and migrate_ui)
Special challenges
• You know, other than the lack of documentation and size of the exported data
• base64 encoding, sometimes• $row-‐>xml-‐>{'body'}['encoding'] - print_r() doesn’t always help
• Joins. O, Joins!• Tried MigrateSourceMultiList, ended up caching or doing lookups
• Sometimes manually loaded migration maps
• Can’t rollback followups
• Drupal doesn’t use UTF8mb4 — can’t store emoji
drush
• Migrate help:drush help -‐-‐filter=migrate
• Migrate status:drush ms
• Import, with cunning use of flags:drush mi MigrationName -‐-‐limit=“900 items” -‐-‐feedback=“100 items” -‐-‐instrument
• Force a dependent migration to run:drush mi SubMigrationName -‐-‐force
• Roll back:drush mr MigrationName
• Stop a runaway/slow migration (don’t Control-C!):drush mst MigrationName
fin.questions?