Migrate Module
- Powerful object oriented framework for moving content into Drupal.
- Minimal UI, primarily code based.
- Migrate Extras provides support for many contrib modules
- The best documentation is in the wine.inc and beer.inc example code.
- Migrate is faster, and more flexible but you need to write code to map fields.
- Feeds doesn't work well if you've got different content types that need to reference each other.
Main Concepts:-
- Source.
- Destination
- Map
- Field mapping.
- Field Handling.
- Migration
Source:
- Interface to your existing data (SQL, CSV, XML, JSON).
- Provides a list of fields and descriptions.
- Iterates (reset, next) over rows.
Destination:
destination:-
Mapping of source and Destination in database:
- Connects the source’s ID to the destination’s ID.
- Provides lookup facilities.
- Allows created items to be deleted as part of a rollback.
Field Mapping:-
Source:-
Destination:-
Field mapping from source to Destination:-
- Links a source field to a destination field.
- Lets you look up IDs from the other migration’s maps with sourceMigration().
- If the destination has a complex structure (e.g. Address or file field) then additional data is passed in via arguments().
Migration:
- Code that glues the parts together
- In your constructor you setup: source, destination, map and field mappings
- Allows customization at several points: prepareRow(), prepare(), complete().
Field Handling:-
- Handles the details of converting the field into the structure that Drupal understands.
- Turns $entity->field_bar = “foo” into $entity->field_bar[‘und’][0][‘value’] = “foo”.
- Might pull additional data out of arguments.
Destination Handling:-
- Provides additional functionality to an existing destination, e.g. comment adding a field to nodes for comment status.
- Destination delegates calls to fields(), prepare(), complete() to the destination handlers.
- You probably won’t need to write one.
waiting for more info..
ReplyDelete