DecSyncCC icon indicating copy to clipboard operation
DecSyncCC copied to clipboard

Importing existing Calendar collection as Tasks collection??

Open MaMiMa81 opened this issue 3 years ago โ€ข 8 comments

Good Afternoon Have just upgraded to v.1.5.2 via F-Droid, thank you, & am looking to try to incorporate the new facility for Open Tasks. I am going to make the assumption that Open Tasks will look at *.ics files & will filter out only incorporate those that are configured as "VTODO" (I shall endeavour to confirm this with the Open Tasks dev). Assuming that this is the case can DecSyncCC be configured so that it uses the existing Calendar collection as the Tasks collection? Regards

MaMiMa81 avatar Dec 19 '20 14:12 MaMiMa81

In DecSync CC the calendars and task lists are completely separate. That is also why there are separate 'Calendars' and 'Task lists' collections. If you use Radicale DecSync, you also have to update it to version 1.2.0, otherwise it won't work correctly.

39aldo39 avatar Dec 19 '20 15:12 39aldo39

Good Afternoon Hope you had a good Xmas, thank you for your quick response & my apologies for my slow one. I tried out the 'Calendars' and 'Task lists' setup, which does indeed use Radicale DecSync on my laptop (synced to Calcurse), but for what I would gain - basically only a short task/note description on Calcurse (& therefore essentially in OpenTasks too) would entail a duplication of all my calendar data in Radicale, Radicale DecSync & DecSyncCC with a possibility of conflicts across the 2 collections down the line - so I have binned the idea - for my particular circumstances. Thank you for your continued development & I wish you good luck for the New Year - think we're gonna need it.

MaMiMa81 avatar Dec 29 '20 12:12 MaMiMa81

Thanks for the info @39aldo39 . Happy new year. Is there a plan to support "tasks & calendars"? I'm using calendars for both tasks and calendars (with radicale on computers) and have accumulated lots of entries. It would be really good if that could be supported.

renyuneyun avatar Jan 03 '21 17:01 renyuneyun

DecSync does separate the tasks and calendars. It made technically more sense, and changing it would not be worth it.

But the latest Radicale plugin should also separate the two. Do you have the latest version of that? It will mean that you cannot upload a task to an old collection anymore (as it isn't supported), so you have to create a new collection for just the tasks and import the old one to it.

39aldo39 avatar Jan 04 '21 19:01 39aldo39

Good Afternoon Hope you had a good Xmas, thank you for your quick response & my apologies for my slow one. I tried out the 'Calendars' and 'Task lists' setup, which does indeed use Radicale DecSync on my laptop (synced to Calcurse), but for what I would gain - basically only a short task/note description on Calcurse (& therefore essentially in OpenTasks too) would entail a duplication of all my calendar data in Radicale, Radicale DecSync & DecSyncCC with a possibility of conflicts across the 2 collections down the line - so I have binned the idea - for my particular circumstances. ................

Morning Thought I would just post an update after taking into account your responses, upgrading your app to the latest version (v.1.6.2) & exploring Calcurse further (which is the key to the solving the issues I had experienced earlier). Calcurse gives you the option to use & display a defined 'apts' (appointments - VEVENT's) file different from the default file by the flag " -c /path/to/new 'apts' file". So I copied the default 'apts' file to the new desired location & then cleared all events from the original default 'apts' file (empty file). I display Calcurse on my laptop: calcurse -c /path/to/new 'apts' file which works fine.

Then for syncing to/from Radicale, via the Vdir, using vdirsyncer & calcurse-vdir, I modified my original sync scrip here:

https://github.com/39aldo39/DecSyncCC/issues/36#issuecomment-674394110

to now point to sync my newly created 'apts' file thus: calcurse-vdir -D /home/mick/.local/share/calcurse/calendar -f -v export /home/mick/calendar/apts && \ vdirsyncer sync && \ calcurse-vdir -D /home/mick/.local/share/calcurse/calendar -f -v import /home/mick/calendar/apts

Setting the "-D" flag with calcurse-vdir allows you to choose a different Calcurse data directory from the default - for my purposes where the newly created 'apts' file is to sync with. Syncing with this defined data directory results in the creation a couple of empty files (conf & todo) plus an empty directory (hooks) by calcurse-vdir but it is of no consequence.

I have made some minor alterations to the vdirsyncer config file to reflect that I have now renamed the Vdir directory for 'apts' from 'calcurse' (appointments - VEVENT's) to: ~/calendar/apts/

I tested syncing between laptop & phone with this new arrangement & all works fine.

Now setting up tasks. I installed Open Tasks on the phone & set it up to sync via DecsynCC & Syncthing to the laptop. This provides a tasks collection directory, same like the calendar collection directory, from the phone right through to Radicale. I then set up a sync instance for Radicale to Calcurse on the laptop, again via the Vdir (with a newly created tasks directory ~/calendar/tasks/), using vdirsyncer & calcurse-vdir, but this time pointing to the the default Calcurse data directory. I created a new sync scrip for this, based on my original one (see link above), in the Calcurse config directory (where calcurse-vdirsyncer.sh is also located) named calcurse-vdirsyncer-tsks.sh:

#!/bin/sh calcurse-vdir -f -v export /home/mick/calendar/tasks && \ vdirsyncer -c /home/mick/.config/vdirsyncer/tasks/config sync && \ calcurse-vdir -f -v import /home/mick/calendar/tasks

A new vdirsyncer config file needs to be created for this sync instance & is set with the "-c" flag which points to it. This config file is pretty similar to the one for syncing 'apts' only changing the directory names & paths & descriptions to reflect it is for 'tasks' & not 'apts'. Tested & working & now called automatically on a regular basis via cron, just like the 'apts' setup. Hope this might help anyone considering this kind of scenario.

MaMiMa81 avatar Feb 03 '21 10:02 MaMiMa81

@MahMoh-dev Let me see if I can make things a bit clearer to help you set up syncing OpenTasks with calcurse. Presently you have got your appointments (apts) synced right through from Etar to calcurse. So now configure DecsynCC to use OpenTasks. This will set up a tasks collection in your Decsync directory on your phone & a Decsync tasks list in OpenTasks. Put some tasks in this list. When you next sync your phone to your PC your tasks collection will sync just the same as your calendar collection right through to your ~/.var/lib/radicale/collections/collection-root/mick/ directory.

Now you have the calendar collection synced via vdirsyncer sync to the 'database' (vdir) directory:

~/calendar/calcurse/

I have now renamed this directory to:

~/calendar/apts/

This is a more accurate & clearer description for this data plus now:

I then created an empty directory alongside it for the tasks 'database' (vdir):

~/calendar/tasks/

Moving on to configuring vdirsyncer I then created a new config in the ~/.config/vdirsyncer $ tree -f

SS1

As can be seen above inside the ~/.config/vdirsyncer directory is the original config file for syncing apts with the status directory associated with that, plus 2 more directories ~/.config/vdirsyncer/tasks/ & ~/.config/vdirsyncer/contacts/ which have configuration setups for tasks & contacts respectively. The reason for separate configs will become apparent below. You stated you have already setup your contacts sync so I will only discuss the tasks setup.

Here is my config for syncing tasks from the ~/.var/lib/radicale/collections/collection-root/mick/ directory to the tasks 'database' (vdir) ~/calendar/tasks/:

# An example configuration for vdirsyncer.
#
# Move it to ~/.vdirsyncer/config or ~/.config/vdirsyncer/config and edit it.
# Run `vdirsyncer --help` for CLI usage.
#
# Optional parameters are commented out.
# This file doesn't document all available parameters, see
# http://vdirsyncer.pimutils.org/ for the rest of them.

[general]
# A folder where vdirsyncer can store some metadata about each pair.
status_path = "~/.config/vdirsyncer/tasks/status/"

# CALDAV
[pair pepp_tsks]
a = "mick_tasks"
b = "mick_rad_tsks"
collections = null
conflict_resolution = "a wins"


# Calendars also have a color property
metadata = ["displayname", "color"]

[storage mick_tasks]
type = "filesystem"
path = "~/calendar/tasks/"
fileext = ".ics"

[storage mick_rad_tsks]
type = "caldav"
url = "http://localhost:5232/mick/tasks-51deba3a-e46e-4b85-868a-4baf4bf50b2e/"

Because the config file for syncing the task files is not in the default ~/.config/vdirsyncer/ directory you have to point vdirsyncer to it when invoking:

vdirsyncer -c ~/.config/vdirsyncer/tasks/config discover

then:

vdirsyncer -c ~/.config/vdirsyncer/tasks/config sync

Now moving onto the calcurse data set up at:

~/.local/share/calcurse $ tree -f`

SS2

As can be seen I have created a duplicate calcurse data directory inside the default calcurse data directory named calendar: ~/.local/share/calcurse/calendar/

This is the directory that is used for appointments (apts). I moved the original apts file in ~/.local/share/calcurse to ~/.local/share/calcurse/calendar/plus I have created a symlinked Notes directory (see below).

The displaying of the calcurse calendar in the terminal is then invoked by:

calcurse -c /home/mick/.local/share/calcurse/calendar/apts

to point to the appointments file.

To sync between the 'database' (vdir) directory ~/calendar/apts/& the calcurse apts file ~/.local/share/calcurse/calendar/apts it is invoked by:

calcurse-vdir -D /home/mick/.local/share/calcurse/calendar

to point at the correct location.

I have wrapped the whole sync process up in my basic script `calcurse-vdirsyncer.sh':

#!/bin/sh
calcurse-vdir -D /home/mick/.local/share/calcurse/calendar -f -v export /home/mick/calendar/apts && \  
vdirsyncer sync && \
calcurse-vdir -D /home/mick/.local/share/calcurse/calendar -f -v import /home/mick/calendar/apts

As stated in my comment 3 previously in this thread, syncing with this defined data directory results in the creation a couple of empty files conf & todo plus an empty directory hooks by calcurse-vdir but this is of no consequence. One thing to note is that I have symlinked the Notes directory in the ~/.local/share/calcurse/calendar/ directory to the Notes directory in the default ~/.local/share/calcurse directory. This is because Notes are used by both apts & todo - this doesn't create conflicts or duplicates.

Tasks are presently synced up to the tasks 'database' (vdir) ~/calendar/tasks/ & as we are syncing with the default calcurse data directory just running calcurse-vdir -f -v export /home/mick/calendar/tasks & calcurse-vdir -f -v export /home/mick/calendar/tasks is necessary.

Again this I have wrapped up in a basic script - named calcurse-vdirsyncer-tsks.sh:

#!/bin/sh
calcurse-vdir -f -v export /home/mick/calendar/tasks && \ 
vdirsyncer -c /home/mick/.config/vdirsyncer/tasks/config sync && \
calcurse-vdir -f -v export /home/mick/calendar/tasks

So this is why I have got a different config file for apts & tasks with vdirsyncer sync because when I combine the sync processes into scripts apts & tasks need to point to different directories - also keeps the processes nice & separate.

I don't know if this helps but hopefully it has made things somewhat clearer Good luck!

MaMiMa81 avatar Feb 10 '22 05:02 MaMiMa81

@MaMiMa81 This is rightfully much clearer. It did work!๐Ÿ”ฅ No google spyware, no internet dependency, clean and simple (well.. sort of๐Ÿ˜…). Thanks for your time, and for your great details.

mhdna avatar Feb 10 '22 17:02 mhdna

No worries ๐Ÿ˜‰

10 Feb 2022 17:41:10 Mah @.***>:

@MaMiMa81[https://github.com/MaMiMa81] This is rightfully much clearer. It did work! ๐Ÿ”ฅ No google spyware, no internet dependency, clean and simple (well.. sort of ๐Ÿ˜… ). Thanks for your time, and for your great details.

โ€” Reply to this email directly, view it on GitHub[https://github.com/39aldo39/DecSyncCC/issues/47#issuecomment-1035220396], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AO6MN7BHCOPAYMSRH4BG4TDU2P2DDANCNFSM4VCK7ODA]. Triage notifications on the go with GitHub Mobile for iOS[https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675] or Android[https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub]. You are receiving this because you were mentioned. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAB9JREFUaIHtwQEBAAAAgiD/r25IQAEAAAAAAAAAAC8GJDAAAY7rwGcAAAAASUVORK5CYII=###24x24:true###][Tracking image][https://github.com/notifications/beacon/AO6MN7A2H5GS46EC5K2355TU2P2DDA5CNFSM4VCK7ODKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHW2DLLA.gif]

MaMiMa81 avatar Feb 10 '22 17:02 MaMiMa81