I've been doing a bunch of D6 => D6 migrations and one thing that would be very helpful would be a source that could load the relevant info from {node_type}, {content_node_field} and {content_node_field_instance} and handle the drudgery of joining in the fields for a given node type (and in prepareRow() do the subqueries needed for multi-value fields).

I'll probably be working on this so I wanted to post an issue to make sure there's isn't already something like this, and to get feedback on the approach.

Comments

mikeryan’s picture

Category: task » support

I think this use case is a little narrow to be packaged with Migrate itself. There are two efforts in this area I can speak to:

  1. I've done a little proof-of-concept work on a Drupal equivalent of WordPress migrate, a generic module to support Drupal-to-Drupal imports. That is based on RESTful services rather than direct DB import, though. I'm not sure if/when it will emerge as a contrib project.
  2. On a project we both worked on, @q0rban developed some code to do direct database Drupal 6->Drupal 7 imports along the lines of your conception. Perhaps he can speak to that here (or if not, I can dig up the code and try to figure it out:-).

Note that both of these approaches involve services on the source side (q0rban had JSON services returning field metadata).

artatac’s picture

I am also struggling. I have a d6 site with article, cck image field, tags, title, and maybe book structure. Looking for guidance on pulling alll nodes straight into a fresh d7 install. I have looked at feeds and csv imports but all seem to strip out body text tags eg h2. Can you give any first steps guidance or point to any documentation. I have always bottled this in the past and spent a day manually copy and pasting between two browser windows!

drewish’s picture

Mike, I find myself rebuilding what you were describing in your first example (but D6->D7 and we're moving some nodes into Webform submissions). I've started building out a custom service to expose CCK/profile fields for nodes and users, list nodes/users, and serialize node/user objects but am realizing there's some things that are hard to get right. I'm starting to appreciate the issues with exposing 54,000 user ids (results in 17mb of JSON if you don't paginate it) and I'm going to have to figure out how to implement the whole high water mark feature so we can keep importing users and nodes until we make the final cutover to the new site.

Is your code in any kind of a state to share? I'd love to avoid the duplication and help clean that up if it's an option.

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new1.22 KB
new2.26 KB

Rather than a custom service, I used the services module on the D6 side, with the attached migrate_service module to configure the source side. On the destination side, I created an extension of the JSON source plugin (attached as drupal_source.inc), and in the term migration (which is as far as I got with this little proof-of-concept) set up the source thusly:

    $this->source = new DrupalSource($this->getEndpoint(), $this->getToken(),
      'taxonomy_term', 'tid', $fields);

Hope this helps a bit.

moshe weitzman’s picture

I have not looked closely at it, but migrate_remote looks pretty on topic here - http://drupal.org/sandbox/fgm/1138504. If you try it, let us know what it does :)

drewish’s picture

I went the custom module route after looking at services and feeling like their index handlers were pretty brain dead with the hard coded 20 item page size. It seemed like a lot of overhead for what was pretty simple. I also added a callback to kick out the list of fields for each node type and users. Seems kind of similar to what migrate_remote is trying to do but we had a D6 site so I don't feel as bad about not using that.

mikeryan’s picture

Yes, the hardcoded page size was an annoyance I ran into. Thought I had put in a feature request but it seems not; however, the topic has been picked up and there is a patch in the queue: #1186738: add pagesize to services_resource_build_index_query

mikeryan’s picture

Another services-based approach: Content API.

mikeryan’s picture

See also #1234528: Include a module with classes to migrate content from Drupal 6 to Drupal 7. And, the core issue #1052692: New import API for major version upgrades (was migrate module) is also relevant - assuming we go ahead with that (D7->D8 core upgrade using Migrate API), I'll certainly try to make it general enough to easily be repurposed for D6->D8, and easily be backported in contrib for D?->D? migrations.

But, that's a long-term solution. In the short-term, I think the most general answer is to extend services to deliver what we want from the source side, and develop the Migrate classes I started on for the destination side. I do usually want to migrate directly from the source database if at all possible, but a services-based approach would be useful in cases where that isn't practical, and I don't really want to develop both SQL-based and XML-based migrations for this use case. Unlike external CMS cases, where you may be forced to use some lousy XML service that does more to obscure than illuminate the data, we actually have some influence on the source side.

naught101’s picture

Not usre how relevant this is, but http://drupal.org/sandbox/frjo/1332996 has some d6 sources

mikeryan’s picture

I actually have an approach of my own in the works, more general than frjo's, I'm hoping to be far enough along to make a sandbox in January.

naught101’s picture

mikeryan’s picture

Yes, forgot I had reserved the sandbox a while ago. I've got a hot D6-to-D7 project on my plate now, hoping to fill in that sandbox within the next couple of weeks.

naught101’s picture

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed
naught101’s picture

@Mike: git push?

mikeryan’s picture

naught101’s picture

Right, sorry, was looking in the master branch. stupid me.

Status: Fixed » Closed (fixed)

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