0
votes

We have TRAC 0.11 server. Unfortunately we have deleted a milestone in one of our project. How to recover deleted milestone and open tickets in the deleted milstone ?

when i am running the milestone list command it is not showing my deleted milestone information. if any body know to recover deleted milestone and tickets. Help will be appreciated

2

2 Answers

0
votes

You will need a tool that lets you execute SQL directly against the database being used for Trac. By default, Trac is installed to use SQLite, The SQLite website has a good list of tools that can be used to edit SQLite data.

Find the location of your SQLite database (you can look in your trac.ini file for that) and then use any one of the tools listed on the SQLite website to execute the queries listed above.

2
votes

Deleting a milestone does not mark it deleted so it cannot be simply recovered. Your tickets are not gone, they are just not currently associated with the deleted milestone.

What you can do is:

  1. Recreate the milestone in Trac
  2. Use SQL access look up the change events to find the affected ticket IDs and then update those back to the deleted milestone.
  3. In this example the milestone is M5. You will need to determine the time when it happened so you restrict your 'fix' to the actual milestone delete event

    UPDATE ticket set milestone = 'M5' WHERE id IN (
    SELECT  ticket FROM ticket_change WHERE 
    field = 'milestone' AND 
    oldvalue = 'M5' AND 
    newvalue IS NULL AND
    time > '1332955533289000' -- put in the right time for where your delete happened
    ORDER BY "time" DESC )