Closed (works as designed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 May 2011 at 14:07 UTC
Updated:
17 Mar 2014 at 21:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Niklas Fiekas commentedIs there a way to hook in during rollback and undo the variable_set?
Comment #2
mikeryanNote that in addition to prepare/complete (which are executed for each input row), there are preImport/postImport (executed before and after the full migration import is run) - updating/resetting the variable would best be done there.
I'll add a page to the docs when I have a chance, thanks!
Comment #3
Niklas Fiekas commentedVery good.
I suppose there is no way to get the rolled back term ids in postRollback() or to gather them while the single rows are rolled back? postRollback would be much more useful, if you knew what was rolled back.
Update: Of course, the same is true for postImport().
Comment #4
mikeryanUntested:
There is also a corresponding prepareRollback($entity_id), called before taxonomy_term_delete/node_delete/whatever_delete.
Comment #5
Niklas Fiekas commentedYes, that works well.
--
The Node (= Thread) and Comment (= Post) imports for this are just like any other.
So: "fixed for me".
Comment #6
FrequenceBanane commentedHello,
I only have one forum category/board, so I want everything to be in the forum with tid = 1.
You say forum importation works fine for you, but I cannot update forum and forum_index table values; then, even though my nodes and comments are created (with the right taxonomy_forum value), they do not appear on my website.
What is the trick ?
Comment #7
Niklas Fiekas commentedI barely have time for explaining, so I'll just attach my full import script for the chance that it might help. Terms are boards, nodes are threads, comments are posts.
Comment #8
Niklas Fiekas commentedI barely have time for explaining, so I'll just attach my full import script for the chance that it might help. Terms are boards, nodes are threads, comments are posts.
Comment #9
Docc commentedA tiny mistake
It should be:
if (!in_array($container, $containers)) {not
if (!in_array($entity->tid, $containers)) {in the postImport function. Now it just keeps adding to the array because $entity does not exist.
Comment #10
Niklas Fiekas commentedThank you, that's right.
Comment #11
rocketeerbkw commentedJust to add another example, here's how I managed containers.
Comment #12
StuartDH commentedJust in case anyone is looking for more info, I've added half a dozen pages on migrating a vBulletin forum to Drupal 7 to the documentation
Comment #13
mikeryanLooking back at this, we could easily define a MigrateDestinationForum class that extends MigrateDestinationTerm, adding a "container" boolean to the list of destination fields and managing the forum_containers variable automatically...
Comment #14
StuartDH commentedHi Mike,
If it hasn't been implemented already, would it be possible to make this a sort of general MigrateDestinationStructure? It could then be used for forums, as well as galleries, directories etc, which also use containers that aren't quite the same as taxonomies?
Stuart
Comment #15
havran commentedHi, i have problem with #5 approach. I migrating forums from D6 to D7. All forum terms are migrated correctly and all correctly marked as containers. But rollback not working as expected. All rows from map table is removed but all terms still remains in D7 database. If i debug my code i find out my function completeRollback is never called.
Thanks for any advice.
Comment #16
havran commentedI found out problem was in module og_forum. This module prevent migration load taxonomy_terms and then this terms remains in taxonomy_term_data table. If i disable this module rollback run correct and remove all taxonomy terms and containers.
Comment #17
havran commentedAlso if you imported forum topic you need set destination variable forum_id. I use for now:
Then node correctly stored and show on its forum. But this still create notice in function forum_node_presave() :-(.
--
Edit:
I find solution (thanks to Devel issue #839770) - for forum nodes we need set node nid to NULL:
Then notice go on.
Comment #18
13rac1 commentedDiscussion seems complete on this old issue. Closing.