Restore xml file

Asked by Niels on 2012-05-06

After an error while starting gtg all my tasks are gone. The tasks are still in the xml file and the projects.xml file refers to the right file. Still, when i open gtg there are no tasks visible.

could you suggest a way to repair this?

thanks

Niels

Question information

Language:
English Edit question
Status:
Solved
For:
Getting Things GNOME! Edit question
Assignee:
No assignee Edit question
Solved by:
Niels
Solved:
2012-05-08
Last query:
2012-05-08
Last reply:
2012-05-06

Hi,

GTG automatically makes several backups of your tasks and projects.
With luck, you should a working backup available.

Look into .local/share/gtg/ in your home. You should find files named like this:

XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.xml
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.xml.bak.<N>
projects.xml
projects.xml.bak.<N>

where the X's are letters or numbers (this actual sequence of letters
and numbers is different for everyone it's a kind of random pattern),
and <N> is a number between 0 and 7.

example content of .local/share/gtg/:

ea8d1d10-0a33-4ae7-aa34-fb85f7556e16.xml
ea8d1d10-0a33-4ae7-aa34-fb85f7556e16.xml.bak.0
ea8d1d10-0a33-4ae7-aa34-fb85f7556e16.xml.bak.1
projects.xml
projects.xml.bal.0
projects.xml.bal.1

Here's how you can restore a backup:

NOTE:I suggest you make a copy of the whole directory content before
doing anything!

Then do the following:

1) remove XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.xml and projects.xml.
2) Pick a pair of matching
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.xml.bak.<N> and
projects.xml.bak.<N> (with the same <N>)
3) Rename them to XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.xml and projects.xml
4) Restart Getting Things GNOME!

Example process (in a shell):

1) cd ~/.local/share/gtg/
2) rm ea8d1d10-0a33-4ae7-aa34-fb85f7556e16.xml projects.xml
3) mv ea8d1d10-0a33-4ae7-aa34-fb85f7556e16.xml.bak.0
ea8d1d10-0a33-4ae7-aa34-fb85f7556e16.xml
4) mv projects.xml.bak.0 projects.xml

If the backup files are sane, this should restore your tasks with
little or no loss! You may have to try several backup until finding a
good one.

Bertrand

On Sun, May 6, 2012 at 5:05 PM, Niels
<email address hidden> wrote:
> New question #196249 on Getting Things GNOME!:
> https://answers.launchpad.net/gtg/+question/196249
>
> After an error while starting gtg all my tasks are gone. The tasks are still in the xml file and the projects.xml file refers to the right file. Still, when i open gtg there are no tasks visible.
>
> could you suggest a way to repair this?
>
> thanks
>
> Niels
>
> --
> You received this question notification because you are a member of Gtg
> developers, which is an answer contact for Getting Things GNOME!.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~gtg
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~gtg
> More help   : https://help.launchpad.net/ListHelp

--
Bertrand Rousseau

Dear Bertrand,

i followed you're instructions and produced an error.
i gues it must have been the same error that started the problem but i am not sure.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/liblarch/processqueue.py", line 43, in process_queue
    func(*action[1:])
  File "/usr/lib/python2.7/dist-packages/liblarch/tree.py", line 214, in _add_node
    self._callback("node-added", node_id)
  File "/usr/lib/python2.7/dist-packages/liblarch/tree.py", line 78, in _callback
    func(node_id)
  File "/usr/lib/python2.7/dist-packages/liblarch/filteredtree.py", line 130, in __external_modify
    return self.__update_node(node_id,direction="both")
  File "/usr/lib/python2.7/dist-packages/liblarch/filteredtree.py", line 219, in __update_node
    self.send_add_tree(node_id, parent_id)
  File "/usr/lib/python2.7/dist-packages/liblarch/filteredtree.py", line 282, in send_add_tree
    self.callback('added', node_id, path)
  File "/usr/lib/python2.7/dist-packages/liblarch/filteredtree.py", line 125, in callback
    func(node_id,path)
  File "/usr/lib/python2.7/dist-packages/liblarch/__init__.py", line 245, in __emit
    func(node_id,path)
  File "/usr/lib/python2.7/dist-packages/liblarch_gtk/treemodel.py", line 140, in add_task
    value = access_method(node)
  File "/usr/lib/python2.7/dist-packages/liblarch_gtk/__init__.py", line 283, in <lambda>
    return lambda node: func(node, default)
  File "/usr/share/gtg/GTG/gtk/browser/treeview_factory.py", line 90, in task_bg_color
    return colors.background_color(tags,bg)
  File "/usr/share/gtg/GTG/gtk/colors.py", line 32, in background_color
    for my_tag in tags:
TypeError: iteration over non-sequence

i have trouble interpreting this and hope you may have an idea on what is going wrong.

I have also tried reinstalling gtg. This results in a second .local\share\gtg directory
i have tried putting the xxx-xxx.xml and project.xml file from the old dir in the new one and (after the first one failed) copied the content from the old xxxx-xxx.xml file in the new.

In both these cases i didn't get the error i mentioned above but i also didn't get my old tasks back even though they are visible in the xml file when i open these in a text editor.

hi

the reinstallation seems to have worked after all in combination with moving the right backup file and project file.
I just didn see the results because i kept opening new instances of gtg in the bar.
sorry for wasting you're time

thanks
Niels