backup

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.

Hopefully it’ll be good on tips from here on out.

Here be what’s went on with us this past week. We got our asses kicked.

Work

  • bartendJerb is basically gone. Business levels have dropped below what’s sustainable for the place mid-term, but management won’t adjust labor, nor menu, nor open hours. They keep waiting for the weather to get cold. Guess what! It’s cold now! And it’s still slow!
  • mgbarJerb: Getting ever busier. We don’t think the corpos expected our location to come out swinging this hard, and yet here we are; getting no support from them while they try to tell us how to do our jobs. There is no institutional knowledge at the corporate level and they don’t provide mechanisms to keep it at the location level. Very little of the two weeks-long training I went through has actually been useful.

Personal

We got mamasha, our storage server, back online. She was offline for nearly three months cos we didn’t have to deal with an entire failed raidz2 pool. But it’s back online and so far, no issues. I have a bit more to say on this since a well-administered ZFS pool is not supposed to fail like this but here we are, restoring from a backup made two years ago, right before I mostly lost sentience.

Today the criminal president-elect announced 25% tariffs on all products coming from Mexico, Canada, and China. Better start a garden so you can have tomatoes, avocados, lettuce and jalapeños (they come from Mexico). If you’re building a house, you need to have your contractors finish ASAP (most lumber is imported from Canada). If you need electronics, you need to buy them now. Service industry will see the price of tequila, mezcal, beer (Modelo, Pacifico, XX Lager) go up.

Myself I’m starting the build-out process for a new storage server. mamasha’s hardware is from 2012 (Xeon E3-1220 V2, SuperMicro X9SCM-F) with the motherboard already getting replaced once. It’d be nice to have something with just as many PCI-E slots so we can put a nice GPU and see what’s what with self-hosted LLM tooling. We don’t condone the use of genAI for artistic purposes but that’s where tech is going so we need to learn how to deal with it even if it’s from an adversarial standpoint.

Bringing this server back online was my win of the week. We’ll take it.

Learning

We need to start learning new stuff. Picked up a copy of Meehan’s Bartender Manual and honestly we think it is helping us understand more about bartending as a profession.

Today we think we’ll go to the library and renew our library card. If it all goes to shit in the US it’d be useful to know another language. German, French or Czech would be nice.

Rebuilt our nextcloud VM since it died when out zpool crashed. It’s been okay to re-learn all of these things, the first time I configured the VM we didn’t keep much in the way of notes.

Speaking of notes… we’re now using obsidian instead of vim+wiki.vim. We don’t spend that much time on our workstation anymore and we need our notes available on the phone without having to fiddle on the command line on the phone. It’s a pain in the ass honestly.

Intersections

Now, on the intersection of work and personal… my phone scrobbles to last.fm whatever songs are being played in my environment. INXS is picking up steam as it is on the playlist at mgbarJerb.

They are also starting to push hard on the Christmas music and that’s going to be messy; had the displeasure of listening to an EDM remix of little drummer boy. Just… no.

This week we get an additional day off because of Thanksgiving. From here until the end of the year it’ll be madness at work.

The correct time to back up your computer was today, two hours ago.

 

Scroll to Top