Greetings to the community!

Could anybody point me at the current situation with migrating to drupal from custom sources (ad-hoc php-mysql site)? I've found many sources of migration information, many rather outdated (for instance, mentioning CCK, which is long since in core now). The links i hold open include:
http://drupal.org/node/271
http://drupal.org/migrate
http://www.acquia.com/blog/migrating-drupal-way-part-i-creating-node

So, the question is. How do you migrate data to drupal nowadays? I have users, articles, forum and photos, all with comments. I know the destination entities I want them all be mapped to, but technically, how do i do it? Should I use some clever module to give my tables views-accessible interface and then use migrate? Should I write a php script to perform the migration on a database level: from the source table to the destination (i suppose not)? Should I write another php script to read from a source table and then use drupal api to create complete destination entities?

Thanks in advance.

Comments

WorldFallz’s picture

imo the migration methodology going forward is going to be migrate module based (also see the migrate_d2d module). Hopefully it will get a good ui and possible consideration for core at some point (#1052692: New import API for major version upgrades (was migrate module)). Otherwise, it's probably export-import based using the feeds module.

grigorym’s picture

I'd like to emphasize I'm asking about custom-to-drupal migration, not about drupal-to-drupal migration. The first simple question: how do i migrate users *today*: is it table-to-table? is it table-to-api? is it completely module based (suppose not - no module knows how to extract users from my system)?

Then it's forum topics and comments, for instance. I have to transfer my database records into forum post entities, preserving the authors, so the old-forum-authorid has to be preserved as new-forum-entity-uid. Further on, comments on the forum topic should preserve both the parentid and uid, and so on... What's the least deprecated way to do that?

vm’s picture

the migrate module isn't just for working on drupal to drupal migrations. It is where most of the focus is for custom migrations and handles most of your questions in the OP. However, it doesn't handle the migration automagically. You must generate a module per the migrate.module docs/example module

WorldFallz’s picture

i mentioned 2d2 as a solid example of a migrate module implementation-- it can be (and is) used for all sorts of migrations. So basically my answer remains the same: either feeds based export/import or migrate module.

rolling your own scripts isn't recommended-- particularly if you're new or not extremely familiar with the drupal schema and apis.

sill’s picture

The migrate module is pretty great but also a little tricky as you're basically writing custom code. The nice thing about it though is that once you figure it out it can handle all the situations you mentioned. The drawback being time learning and coding. If you have to migrate data multiple times than this THE BEST way to go. Eg: say you have a list of products that need to be kept current on your site.

Another option to consider is the Feeds module. You can import CSV, RSS and a bunch of other formats. It's not quite as intricate as the migrate module so I'm not entirely sure it'll fit all of your needs.