I have a bunch of events in a non-drupal site. Each event is associated with a facility. On the new drupal site, each facility will be represented by a different domain, using the domain access module.

It would be helpful if the domain ownership could be exposed to the content set. I almost think that it could be done already, as the domain-ID can be seen in Views, so perhaps I've missed it.

Hmm, if I have nodes for the facilities. And if the nodes contain the facilityID from the original data, can I modify the orig_event view to include the domain-ID from those facility nodes? Nope, that still won't help because the domain-ID is not being exposed in the list of destination fields.


frankcarey’s picture

Status: Active » Postponed (maintainer needs more info)

So to clarify, you need a field to import to (you can already get your domain-ID as an input field from views). If your domain-ID field is a CCK field, then you should be able to import it fine. If it makes it's own field, but not through CCK, then you need to write a hook to add the field called MYMODULE_migrate_fields(), if you need to massage the data, then you need to write a hook MYMODULE_migrate_prepare_node() so that the field will be saved when you are done. Please submit it back if you get it to work.

dusedd’s picture

Component: migrate_extras » CCK

any luck resolving this issue...if so, please post back your solution

mikeryan’s picture

Version: 6.x-1.0-alpha2 » 7.x-2.x-dev
Component: CCK » Miscellaneous
Status: Postponed (maintainer needs more info) » Active

V1 is no longer supported, bumping request to V2.

bstoppel’s picture

I'm working upgrading my sites from Drupal 6 to Drupal 7. Both use Domain Access. I'd like to work on a generic solution to this problem using the Migrate module as the base for the solution. I'm having a little bit of trouble understanding how the destination handlers work. Here is what I have grokked about the process so far:

  • Domain Access and its sub-module Domain Source stores information in the db under similarly titled tables, domain_access and domain_source (and potentially in node_access). This is for both Drupal 6 and Drupal 7.
  • By default, the domain_access table is being populated although with the incorrect domain_id. It looks like it is using either the default domain_id or the highest domain_id.
  • Likewise the node_access table is being populated although with the incorrect domain_id. It looks like it is using either the default domain_id or the highest domain_id.
  • The domain_source table is left empty.
  • Simply joining the domain_access and domain_source table to the migration source query, doesn't yield results the right results. It doesn't get multiple domain_access entries. I didn't really expect it to, but I thought I should try.
  • Under Drupal 6, the primary domain was domain_id 0. This has been deprecated. Is there a reliable way to get the replacement for domain_id 0 in Drupal 7? (I can hard code this change for my use case.)

I am assuming that I need to build a destination handler with prepare and fields methods and probably a few more. But I am not sure where to start. I've looked through the migrate_extras handlers to try to clue in on a solution, but haven't been able to grok an approach. It doesn't seem like any of the migrate examples are grabbing extra data from the source database to migrate to the destination database. I could be wrong though. Can someone point me in the right direction and/or to similar code that I can gain insights?


mrkschan’s picture

Status: Active » Needs review
943 bytes

Find attached a simple patch that makes migrate works with domain access :)

Tested with ...
Drupal 7.8
migrate 7.x-2.2
migrate_extras 7.x-2.2
domain 7.x-2.13

mikeryan’s picture

Status: Needs review » Needs work

Please roll an actual patch file.


joshuajabbour’s picture

Status: Needs work » Needs review
1.15 KB

Here's a proper patch. Haven't tested it yet...

agentrickard’s picture

Status: Needs review » Closed (duplicate)

I added Migrate support to DA 7.x.-3.x-dev a few weeks ago. See #1702856: Fix Destination Handler registration