Changing owner of a calendar in Nextcloud

I needed to change the owner of a shared Nextcloud calendar, preferable without causing too many problems for the other user of the calendar (my wife).

Exporting and importing into a new calendar would do that, I feared.

I have all my calendars and address books on a Nextcloud instance, which is part of the Mail-in-a-box setup I have on my mail server.

My current main job was initially just one of several things I had going, so files, mail, contacts and calendars were just kept in subfolders alongside all the rest. Therefore, the work calendars and the family calendar were owned by the same Nextcloud user.

As the job developed into something more substantial, I wanted to keep all that data together in a separate space, and I created a new Nextcloud user for my History Walks.

I moved files, calendars and address books over by exporting and importing, and then manually adjusting all the clients applications on all my computers.

So far, so good.

However, I use the Appointments app in Nextcloud to accept appointments for tours. It can handle conflicts between several calendars, and I needed it to check the shared family calendar too.

I can’t risk getting an automatic booking for our anniversary day.

Unfortunately, the Appointments app only handles conflicts between calendars owned by the same user. It is not enough for the calendar to be shared.

Equally problematic, there’s no obvious way to transfer a calendar from one user to another, at least not in the web interface.

It took me a while to discover that the command line interface to Nextcloud had such a function.

There are two steps.

The command:

occ dav:list-calendars user

lists the calendars owned by user. The first column in the output is the URI of the calendar.

To actually move the calendar use:

occ dav:move-calendar -f URI old-user new-user

The -f option is needed to keep the shares.

I had hoped this would go unnoticed on my wife’s phone, but it didn’t.

The app DAVx5 which we use for synchronising calendars and address books to our phones gave an error, as the WebDAV address of the calendar had changed.

I needed to open DAVx5, update the list of calendars, and mark the new calendar for synchronisation.

It wasn’t as seamless as I had hoped, but it did work OK.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *