I have a custom PHP application which I want to migrate to D7. It's a counseling system: user posts questions, counselors answer it. I want to use the node and comment module, with taxonomy.

However, can I import all the data and maintain the relationships with Migrate? I mean: import users, foreach users import his questions, for each question import its answers.

Can I do this with migrate, or should I start directly with a custom script?

Is there enough documentation to do a simple migration like this successfully?

Thanks

Comments

StuartDH’s picture

It sounds as though it shouldn't be too difficult. I've done something similar with a vBulletin forum and added the process to the migrate module's documents here

I did the above without any php/drupal coding experience and didn't find it too difficult to get the results I was looking for...basically by going through the documentation and migrate module issue pages

Good luck

mikeryan’s picture

Status: Active » Fixed

Yes, Migrate does this easily. The documentation is at http://drupal.org/migrate, and the Migrate module itself contains an example module, migrate_example, demonstrating how to implement migrations - the beer.inc file shows you step-by-step how you migrate users, then nodes (connecting authors), then comments (connecting to their authors and the nodes they're replying to).

sergiu.popa’s picture

Thanks for the answers. I read beer.inc and I started migrating some terms two tables (parent_category, child_category) to a taxonomy vocabulary.

First time didn't get right the hierarchy, but using this code I solved it
$this->addFieldMapping('parent', 'old_category_id')->sourceMigration('ParentTerm')->defaultValue(0);

I'll move on with users, nodes and comments. I'm aware that Migrate module has a learning curve, but I might get a Typo3 project and I'm sure using Migrate will make things a lot easier than custom code, so learning it now it's the perfect moment.

sergiu.popa’s picture

Status: Fixed » Needs work
mikeryan’s picture

Status: Needs work » Fixed

The "needs work" status is for when there's a patch for a bug or feature that's been posted but it, well, needs work. Since the questions that have been asked in this support request have been answered, the appropriate status is "fixed".

sergiu.popa’s picture

Thanks for clarifying this Mike.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.