tasks

Restoring Nextcloud Tasks

A few months ago due to my own laziness we ended up losing my main ZFS storage array­. One of the things lost was my Nextcloud VM, which used a zvol as its main storage space. The files themselves were easily recoverable as we had full copies on three separate machines but we personally use Nextcloud Tasks, and as it turns out there’s no easy way to backup your data from the server itself.

Cue much banging head against keyboard. By sheer chance and an offhand reddit comment leading to a github comment we were able to find a workaround via DAVx and Tasks.org, the software we already were using to sync our calendar and tasks (CalDAV) to our android device.

The issue is that locally the app has a record of the object existing on the server, but when it queries the server the object is no longer there. This indicates that the object was deleted, so Tasks deletes the local copy.

When you restore from a backup you’re restoring the same task that thinks the object exists on the server. When it queries the server again the object is still missing, so the local copy gets deleted again.

What you can do is put your phone in airplane mode, load your backup file, then use long press + multi-select to move all of your data to local lists. Then you can turn off airplane mode, let it sync once (not sure if this is necessary), then move all of your data from the local lists back to the caldav server

edit: tasks doesn’t support exporting to ics, but this is something I would like to support in the future
abaker commented on Feb 16

This gave us a path forward in restoring five years worth of tasks, as we wanted to keep eveything including old archived tasks instead of having to start over. The process is somewhat involved.

DAVx

Disable synchronization for all involved accounts. In my case there were two CalDAV accounts, one for the failed NC server and another for the newly provisioned NC server. Then put your phone in airplane mode just to guarantee there is no communication between your device and the server.

If this gets messed up there is a fair chance everything is lost and we don’t want that, now do we.

Tasks.Org

  1.  ☰ → Settings → Backups → Backup Now. Make sure it’s a folder the OS can access without additional permissions. The default folder is hidden to all apps by default and the only way to get to it is connecting the device to a computer cos Google hates you.
  2.  ☰ , scroll down to the “Local lists”. Create as many lists as you need to restore to NC.
  3. Open the original task list, tap bottom-right ⋮ → Enable “Show completed”. If you don’t do this you’ll only be backing current uncompleted tasks!
  4. Tap upper-right ⋮ → Select all
  5. Tap the list icon List glyph, tap the local list you want to move all of these tasks to.
  6. Repeat steps 3, 4, and 5, for as many lists as you have.

At this point all of your tasks live on your device. Strongly recommend creating another tasks.org backup and immediately copying it to another device just in case your device dies. If you have pets you know how quickly this can happen.

Nextcloud

Create lists to match the local lists on your device (if they haven’t been created already)

DAVx

Disable airplane mode and delete the account for the failed NC server. If you have not added the account for the new NC server, you can do so now (or enable sync for it at this point)

Tasks.Org

Before proceeding, make sure the lists from the new NC server show up in the list manager and your backup is copied off device. Now we basically do the reverse of earlier

  1. ☰ , scroll down to the “Local lists”.
  2. Open the a local task list, tap bottom-right ⋮ → Enable “Show completed” (if it isn’t already).
  3. Tap upper-right ⋮ → Select all
  4. Tap the list icon , tap the NC list you want to move all of these tasks to.
  5. Repeat steps 3, 4, 5 as required.
  6. ☰ → Settings → Backups → Backup Now.

This backup will contain the tasks as connected to the NC account with its lists and should start synchronizing up to Nextcloud. You can also sync manually in DAVx.

We hope this helps someone in the future other than myself, cos it certainly was a total pain in the ass. We originally tried messing with the raw JSON making up the CalDAV objects but due to the way the protocol works going this route failed. Both Nextcloud and tasks.org have exporting data to ICS on the roadmap but it’ll take a while to get implemented.

Better yet, make sure you have replacement hardware for whatever hardware fails, and attend to those failures promptly.

Gonna be a hell of a rager, Thunderbird!

Over the past couple years I’ve been using Nextcloud as my file syncing solution with plenty of success— you just have to make sure to set it up properly. I’ve enabled a couple of extensions for it (they call them “apps”) but the one I truly rely on is Tasks, which enables a CalDAV compatible to-do list.

Now, over the past decade or so I’ve tried a myriad of to-do applications and a lot of them really fell down on their face:
– Google Tasks: They change their interface so often, at the whims of whomever is in charge of that bit of code over at google. It tries to be too smart for its own good. It’s a google application do you don’t actually know if it’ll stick around.
– Google Keep: Free-form management sure, but it gets extremely unwieldy once you try to have more than what can fit on your screen. It also tries to be smart. There also the potential for extinction.
todo.txt: This is meant for people who are on their desk computers all day every day. I’m not.
Remember the Milk. It’s a paid app. At this point I don’t even remember what the limitation was that turned me off it.
wiki.vim: Again, meant for desk use.
Notion: It’s just so slow.
– Evernote: They seem to care more about how your to-do list looks rather than crossing items off it. Also you have to pay for all the goodies.
Microsoft To Do: You need a Microsoft account and they push hard to get you to upgrade to full-on Office.
Org Mode: Emacs. Just… no.
– I’m not listing any apps on iOS cos Apple devices are toys. Yes iPhones take awesome pictures but that’s cos they’re toys for adults.
– Mozilla Thunderbird: No built-in sync with other Thunderbird instances. Given that Mozilla is putting all of its resources into Firefox…

I’ve probably tried using a myriad others but decided against them for one reason or another, be it compatibility with my operating systems of choice, UI/UX decisions made by the part of the developers, lack of sane defaults forcing me to change al of the configuration settings, etc etc. At some point you just give up. Now, the Tasks app on Nextcloud is plenty capable and so far it has been the only one that I’ve been able to stick with longer than two weeks cos it covers all the features I want, which I found quite surprising:
– Web-based interface for availability pretty much everywhere you have a browser and Internet access.
– Hierarchical tasks! (aka subtasks) with notes attached to everything so you can document what you did and how you did it.
– Compatibility with pretty much everything out there via CalDAV. It’s a bit of a pain depending on what you’re using (looking at you, DAVx and tasks.org.

This last point is what I have to poke fun at Thunderbird. For an application that is trying extremely hard to run your life, they don’t fully support CalDAV, namely, hierarchical tasks. Found this on their Bugzilla

\Thunderbird Bugzilla: Bug 194863: Subtask nesting and event triggers (hierarchical to-do): Opened 20 years ago This bug grew up into quite the young adult[/caption]
This bug has been open since February 25, 2003. I’m typing this in January 3, 2023. In less than two months this bug will be able to drink in the United States.

I like you Thunderbird but what the fuck lol.

Scroll to Top