import tasks from TW2 to TW3, preserving change history and timestamps #3835
smemsh
started this conversation in
Show and tell
Replies: 1 comment 5 replies
-
|
Wow, you've handled a number of ugly edge-cases in that script -- nice work! It's worth noting that https://github.com/GothenburgBitFactory/taskchampion-py exists, and it would have been possible for the script to interact directly with the replica via that package. In fact, that's probably a better option than adding complex functionality to |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As someone who refers to task change history often, I was blocked from upgrading to taskwarrior3 until
journal.infosupport was [re]implemented recently (see #3671) (thanks @djmitche!)However, there's still the problem that dump+load to migrate would not preserve change histories, as individual changes are not stored in a JSON export, only the end-state. But then I noticed that the transaction log,
undo.data, does contain all information on all changes, including timestamps for each modification. It means full transaction history could be reconstructed using theundo.datarecords.I therefore made a script to import from the undo.log using individual imports wrapped by
faketime. Using this method, I get a fully correct import with preserved task change histories. Now, withrc.journal.info=1, resulting v3 task info is very close to the original, with no information loss. My undo data had 5335 records, which took 236 seconds to import with an older laptop i7.In case anyone else values their task change history and hasn't upgraded yet for that reason, I wanted to mention the script here so it could potentially help others. Hope someone else finds it useful!
P.S. I do think there should be some kind of command line flag to
task importthat lets one force the time of the operation without needing to wrap withfaketime. Even better, a special key in each JSON record to describe the time of the update (defaulting to the current time) would allow batched imports rather than repeated imports of individual records one at a time.Beta Was this translation helpful? Give feedback.
All reactions