51
Making the Move from TYPO3 to Drupal Bryan House VP Marketing Acquia December 8th, 2011 Ankur Gupta CTO & Chief Architect Srijan Technologies Ritesh Gurung Team Lead Srijan Technologies Ishan Mahajan Migration Lead Srijan Technologies

Making the Move from Typo3 to Drupal

  • Upload
    acquia

  • View
    3.682

  • Download
    3

Embed Size (px)

DESCRIPTION

To view this presentation, visit http://www.acquia.com/resources/acquia-tv/conference/making-move-typo3-drupal-0

Citation preview

Page 1: Making the Move from Typo3 to Drupal

Making the Move from TYPO3 to Drupal

Bryan House!VP Marketing!Acquia!

December 8th, 2011!

Ankur Gupta!CTO & Chief Architect!Srijan Technologies!

Ritesh Gurung !Team Lead !Srijan Technologies!

Ishan Mahajan !Migration Lead!Srijan Technologies!

Page 2: Making the Move from Typo3 to Drupal

Making the move from TYPO3 to Drupal

Page 3: Making the Move from Typo3 to Drupal

Presenters

>> Ishan Mahajan : Lead on migration projects from TYPO3 to Drupal

>> Ankur Gupta : CTO and Chief Architect

>> Ritesh Gurung : Team Lead for Drupal projects; TYPO3 expert

Page 4: Making the Move from Typo3 to Drupal

Srijan Background

•  Formed 2002

•  Worked with TYPO3 from 2004-2009

•  Drupal portfolio started increasing from 2008 onwards

•  Boutique Drupal shop now; dropped Django, TYPO3, Rails consulting services in July 2010

•  ~ 40 people across 2 offices; Delhi region and Dharamshala

•  Built high-traffic portals like MNN.com

•  Carried out migration projects from D5 to D7, CakePHP to D7, TYPO3 to OpenPublish/D7

Page 5: Making the Move from Typo3 to Drupal

Why were clients looking to migrate

•  Not a large TYPO3 developer community as compared to Drupal. Specially in the US

•  Expensive and slow maintenance/upgrade process.

•  Difficult to implement community oriented features.

•  Adding new functionality in Drupal is relatively easier and quicker.

•  Consolidation of all extensions into a single system - TYPO3 custom scripts don't necessarily adhere to the core model.

•  Documentation is scarce.

•  Enterprise support through Acquia.

Page 6: Making the Move from Typo3 to Drupal

Where do we see Typo3 standout?

•  Hierarchical representation Page structure

•  Flexibility in controlling access to content

•  Internationalization

•  Templating

•  Backend for website administration

Page 7: Making the Move from Typo3 to Drupal

Work

•  knr.gl – migration to OpenPublish

•  eastwestcenter.org (primary partner - Forum One Communications)

•  TYPO3_migrate module

Page 8: Making the Move from Typo3 to Drupal

Concerns we heard

•  What all content can be migrated?

•  Can all digital assets be migrated?

•  Can the user information and the relationships with galleries, pages, blogs etc be maintained?

•  Comments on articles and images?

•  Can categories be migrated?

•  Incremental migration be done?

•  How much downtime?

Page 9: Making the Move from Typo3 to Drupal

Migrate module

•  Provides a flexible framework for migrating content into Drupal.

•  It is built for Drupal.

•  Supports core Drupal objects such as nodes, users, taxonomy terms and

comments.

•  Supports migration from XML, JSON, CSV, Databases

•  Incremental migrations

•  Drush commands for import, listing, status, rollback etc

•  Migrate UI module

Page 10: Making the Move from Typo3 to Drupal

TYPO3_Migrate module

Migrating content from a TYPO3 website to Drupal using the Migrate module:

•  Users(both frontend and backend).

•  Standard typo3 pages along with their tt_content elements.

•  News(tt_news) and news categories.

Page 11: Making the Move from Typo3 to Drupal

Using the TYPO3_migrate and migrate modules

Page 12: Making the Move from Typo3 to Drupal

Configure

Page 13: Making the Move from Typo3 to Drupal

Migrate Dashboard

Page 14: Making the Move from Typo3 to Drupal

If you prefer the command line

drush migrate-status

Page 15: Making the Move from Typo3 to Drupal

If you prefer the command line..

Page 16: Making the Move from Typo3 to Drupal
Page 17: Making the Move from Typo3 to Drupal

Migrating users

Page 18: Making the Move from Typo3 to Drupal

Users Mapping

Page 19: Making the Move from Typo3 to Drupal

Running the migration

Page 20: Making the Move from Typo3 to Drupal

Running the migration ...

Page 21: Making the Move from Typo3 to Drupal
Page 22: Making the Move from Typo3 to Drupal

Migrating tt_news content - typo3_news module

•  Taxonomy - News Category

•  Content type - News

Page 23: Making the Move from Typo3 to Drupal

News categories

Page 24: Making the Move from Typo3 to Drupal
Page 25: Making the Move from Typo3 to Drupal

Running the migration

Page 26: Making the Move from Typo3 to Drupal

Migrated Categories

Page 27: Making the Move from Typo3 to Drupal

News articles

Page 28: Making the Move from Typo3 to Drupal

News Mapping

Page 29: Making the Move from Typo3 to Drupal
Page 30: Making the Move from Typo3 to Drupal

drush migrate-import Typo3News

Page 31: Making the Move from Typo3 to Drupal
Page 32: Making the Move from Typo3 to Drupal
Page 33: Making the Move from Typo3 to Drupal

Incremental Migration

•  Highwater mark field.

•  Schedule(via cron) regular updates.

Page 34: Making the Move from Typo3 to Drupal

Steps for defining migration

Page 35: Making the Move from Typo3 to Drupal
Page 36: Making the Move from Typo3 to Drupal

Lets have a look at the code

Page 37: Making the Move from Typo3 to Drupal

Step 1: implement hook

•  Define your own module and let the migrate module know about it.

•  Implement hook_migrate_api

•  function mymodule_migrate_api() {

•  return array(

•  'api' => 2,

•  );

•  }

Page 38: Making the Move from Typo3 to Drupal

Step 2: define migration class

•  Give description.

•  Let migrate know about the source of your content.

•  Let migrate know about the destination type.

•  Map the source and destination fields.

•  Massage the data before being migrated.

Page 39: Making the Move from Typo3 to Drupal

Step 2(contd)

class Typo3NewsMigration extends Migration {

public function __construct() {

parent::__construct();

...

}

public function prepare(stdClass $node, stdClass $row) {

...

}

}

Page 40: Making the Move from Typo3 to Drupal

Functions

•  public function __construct() {..}

o  Define the destination type(node, user, comment etc) o  Describe the source(databse, xml etc.) o  Field mappings

•  (optional) public function prepare(stdClass $node, stdClass $row) {..}

o  Massage the data that was pulled in – clean up text, links etc.

Page 41: Making the Move from Typo3 to Drupal

Step 2a: Give Description

•  Class description

o  $this->description = t('News migration from TYPO3'); •  Dependencies

o  $this->dependencies = array('Typo3NewsCategory'); ...

Page 42: Making the Move from Typo3 to Drupal

Step 2b: Setup source query $query = db_select(TYPO3_DATABASE_NAME . '.tt_news', 'tn')

->fields('tn', array('uid', 'crdate', 'tstamp', 'pid', 'title', 'hidden', 'short',

'bodytext', 'author', 'author_email', 'image', 'imagecaption', 'links', 'ext_url', 'news_files'))

->fields('catmm', array('sorting', 'uid_foreign'));

$query->condition('tn.deleted', '0');

$query->leftJoin( TYPO3_DATABASE_NAME . '.tt_news_cat_mm', 'catmm', 'catmm.uid_local = tn.uid');

$query->leftJoin( TYPO3_DATABASE_NAME . '.tt_news_cat', 'newscat', 'newscat.uid = catmm.uid_foreign');

// Related news articles

$query->leftJoin(TYPO3_DATABASE_NAME . '.tt_news_related_mm', 'relatedmm', 'relatedmm.uid_local = tn.uid');

$query->orderBy('tn.tstamp', 'ASC');

$query->groupBy('tn.uid');

$query->addExpression('GROUP_CONCAT(newscat.title)', 'newstags');

Page 43: Making the Move from Typo3 to Drupal
Page 44: Making the Move from Typo3 to Drupal

Step 2c: Map the Data

•  Let the migrate module know the type of source

o  $this->source = new MigrateSourceSQL($query); •  Similarly provide the destination handler

o  $this->destination = new MigrateDestinationNode('news');

Page 45: Making the Move from Typo3 to Drupal

Step 2d: Map the fields

•  Field mappings take the form:

o  $this->addFieldMapping(‘destination_field_name’, ‘source_field_name’); •  Can define default values

o  $this->addFieldMapping('language') ->defaultValue('en');

Page 46: Making the Move from Typo3 to Drupal
Page 47: Making the Move from Typo3 to Drupal

Step 3:Massage the data

•  On its way to Drupal!

public function prepare(stdClass $node, stdClass $row){

$node->status = ($row->hidden) ? '0' : '1';

$node->body = $this->processLinkTag($node->body);

}

Page 48: Making the Move from Typo3 to Drupal

Migrate Example

Page 49: Making the Move from Typo3 to Drupal

Resources

Download and install the modules

•  http://drupal.org/project/migrate

•  http://drupal.org/project/TYPO3_migrate

Page 50: Making the Move from Typo3 to Drupal

Acquia is Hiring!

• Do you love working with Drupal?!

• Acquia is hiring in North America and Europe!- Engineering!- Design!- Client Advisors!- Inside Sales!

http://acquia.com/careers!

Page 51: Making the Move from Typo3 to Drupal

Questions!

•  For more information visit: http://www.acquia.com!•  Follow us: http://www.twitter.com/acquia!•  Contact us: [email protected] or 888.9.ACQUIA!

•  Contact Srijan Technologies: Rahul Dewan, [email protected]!

Todayʼs webinar recording will be posted to:!

http://acquia.com/resources/recorded_webinars!