6.0.0-beta1
7/4/25

[#4732] New, faster datatree history migration script
Summary New, faster datatree history migration script
Queue Horde Base
Queue Version 3.1.3
Type Enhancement
State Resolved
Priority 1. Low
Owners
Requester josh (at) endries (dot) org
Created 12/05/2006 (6786 days ago)
Due
Updated 12/09/2006 (6782 days ago)
Assigned
Resolved 12/09/2006 (6782 days ago)
Milestone
Patch Yes

History
12/09/2006 02:37:19 AM Chuck Hagenbuch Comment #5
State ⇒ Resolved
Reply to this comment
Committed, thanks.
12/05/2006 09:18:57 PM josh (at) endries (dot) org Comment #4 Reply to this comment
Yes, those are probably parent entries. I haven't had a chance to
look yet to see why your script isn't deleting them, but you should
be able to kill everything with a group_uid of horde.history. Then
you can use this snippet to find any "orphaned" datatree_ids that
should be purged from horde_datatree_attributes:
The lines are not deleted because the delete statements are within the 
attribute loop, and since there are no attributes it never enters that 
loop. Moving the delete lines out of that loop (down three lines) 
should take care of it. They should probably be outside the loop 
anyway since they have nothing to do with the data tree object's 
attributes, only the object itself, oops!



Josh
12/05/2006 07:08:26 PM Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
One thing I've noticed with some more testing is that I have some
datatree elements that don't have any attributes. These rows don't
get deleted from the old history database, and I'm not sure if they
are supposed to or not. Here is a snip of these rows:

mysql> SELECT c.datatree_id, c.datatree_name, c.datatree_parents,
c.datatree_order FROM horde_datatree c WHERE c.group_uid =
'horde.history' order by datatree_id;
Yes, those are probably parent entries. I haven't had a chance to look 
yet to see why your script isn't deleting them, but you should be able 
to kill everything with a group_uid of horde.history. Then you can use 
this snippet to find any "orphaned" datatree_ids that should be purged 
from horde_datatree_attributes:



SELECT DISTINCT da.datatree_id FROM horde_datatree_attributes da LEFT 
JOIN horde_datatree d ON da.datatree_id = d.datatree_id WHERE 
d.datatree_id IS NULL
12/05/2006 02:46:16 PM josh (at) endries (dot) org Comment #2 Reply to this comment
One thing I've noticed with some more testing is that I have some 
datatree elements that don't have any attributes. These rows don't get 
deleted from the old history database, and I'm not sure if they are 
supposed to or not. Here is a snip of these rows:



mysql> SELECT c.datatree_id, c.datatree_name, c.datatree_parents, 
c.datatree_order FROM horde_datatree c WHERE c.group_uid = 
'horde.history' order by datatree_id;

+-------------+---------------------------------------------------------+------------------+----------------+

| datatree_id | datatree_name                                           
  | datatree_parents | datatree_order |

+-------------+---------------------------------------------------------+------------------+----------------+

|           4 | nag                                                     
  |                  |           NULL |

|          13 | imp                                                     
  |                  |           NULL |

|          17 | turba                                                   
  |                  |           NULL |

|          18 | localsql                                               
  | :17              |           NULL |

|         342 | horde                                                   
  |                  |           NULL |

|         343 | group                                                   
  | :342             |           NULL |

|        1285 | kronolith                                               
  |                  |           NULL |

|        3401 | user@foo.com                            | :17           
     |           NULL |


12/05/2006 02:33:43 PM josh (at) endries (dot) org Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ New, faster datatree history migration script
Queue ⇒ Horde Base
New Attachment: datatree_history_migration.php Download
State ⇒ New
Reply to this comment
This is a new, faster script to migrate the history information from 
the old DB schema to the new, seprate-table schema. This version is 
3000+ times faster for me, which makes me think I've missed some error 
checks or cleanup or something, but AFAICT it does the same thing as 
the current script. Here's my mailing original list post:



http://article.gmane.org/gmane.comp.horde.user/16366



Josh

Saved Queries