I'm trying to migrate a bunch of content that is ordered by a numerical ranking. The Weight module seems to be exactly what I'm looking for, it's fairly mature and I cannot find support anywhere for it. It seems like a natural fit for Migrate Extras; think there'd be any interest? It would probably make a good field handler... Also, apologies if I should be asking in Weight's issue queue instead of here.


#6 weight-migrate-support-1534484-6.patch1.62 KBlee20
Members fund testing for the Drupal project. Drupal Association Learn more


delta’s picture

mikeryan’s picture

Title: Add support for Weight module? » Add migration support for Weight module?
Project: Migrate Extras » Weight
Version: 7.x-2.3-rc1 » 7.x-2.x-dev
Component: Miscellaneous » Code

Yes, the Weight module is the right place to ask.

aendrew’s picture

@delta -- That's for physical weight; Weight module deals with item weighting in the sense "make this piece of content float higher in listings than that piece of content."

@mikeryan -- Good to know; thanks!

davisben’s picture

Status: Active » Postponed

I'm not too familiar with the Migrate module and won't have the time to look into it for at least a few weeks. I'd be glad to review a patch if someone can come up with one.

mirsoft’s picture

Not sure if it helps, but for some simple scenarios it simply helps to migrate the items into destination system in correct order (especially if you are migrating into clean system) by correct setting of ORDER BY source SQL query. Then, the nodes will be inserted into target system in desired order and you get the correct ordering if you add Node: ID to Weight view as second parameter to Weight: Weight.

mirsoft’s picture

Issue summary: View changes

Derp, I meant "field handler" and not "destination handler".

lee20’s picture

Attached is a patch which adds migrate support for weight. The calls to _weight_get_settings() may get heavy if your migrations have a lot of rows. I opened #2256799: Use static caching in _weight_get_settings() to deal with that.

lee20’s picture

Status: Postponed » Needs review

  • davisben committed 910f771 on 7.x-2.x authored by lee20
    Issue #1534484 by lee20: Add migration support.
davisben’s picture

Status: Needs review » Fixed

Committed. Thanks for the patch!

wieringen’s picture

I'm trying to do a migration from d7 to d7. After this patch I have a "weight" destination field. However there is no source field to map from.

Status: Fixed » Closed (fixed)

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

Summit’s picture

Does anybody have code how to migrate weight?
What are the source and destination fields please?
I have the destination fieldhandler...but no D6 source field to choose from within Migrate UI..
greetings, Martijn