Mailing List Archive

Migrate calendars to a new server
I have a running davical server, V 1.1.3.1, Debian Jessie. I want to move it to a new server
running Debian Stretch, davical V 1.1.7 from Backports.
The people are the same, but the LDAP database changes and so their accounts. Therefore I must
export and import the calendars. We have calendars only, no addresses.

I’m using the command from Wiki https://wiki.davical.org/index.php/Backups to export the data like:
psql davical -Atc "SELECT array_to_string(array(SELECT caldav_data FROM caldav_data WHERE dav_name LIKE '/mark/calendar/%'),'');" > exported_calendar.ics

After importing such an exported calendar via davical web interface the are no events in this calendar.
When I export this calendar via Apple iCal and import via davical web interface all is ok.

I see the difference in phppgadmin: The entries in table „calendar_item“ are missing.
How do I export the table „calendar_item“ ?

How do I export and import all calendars in an efficient way?

Thank you.
Re: Migrate calendars to a new server [ In reply to ]
Salut Petra

I backuped the whole davical db and the re-imported it on the
command-line as follows:

#dump

sudo -u postgres pg_dump --clean --encoding=UTF8 -Fc davical >${pgdump}

#restore

sudo -u postgres psql -f ${pgdump}

# apply patches

sudo -u postgres /usr/share/davical/dba/update-davical-database

I was struggling for quite a long time due to character-encoding
problems.? Finally, I switched both -- old- and new- -- servers to
UTF-8..... since then, I have not noticed any problems.

wbr

Lukas

On 14.01.2019 12:23, Petra Humann wrote:
> I have a running davical server, V 1.1.3.1, Debian Jessie. I want to move it to a new server
> running Debian Stretch, davical V 1.1.7 from Backports.
> The people are the same, but the LDAP database changes and so their accounts. Therefore I must
> export and import the calendars. We have calendars only, no addresses.
>
> I?m using the command from Wiki https://wiki.davical.org/index.php/Backups to export the data like:
> psql davical -Atc "SELECT array_to_string(array(SELECT caldav_data FROM caldav_data WHERE dav_name LIKE '/mark/calendar/%'),'');" > exported_calendar.ics
>
> After importing such an exported calendar via davical web interface the are no events in this calendar.
> When I export this calendar via Apple iCal and import via davical web interface all is ok.
>
> I see the difference in phppgadmin: The entries in table ?calendar_item? are missing.
> How do I export the table ?calendar_item? ?
>
> How do I export and import all calendars in an efficient way?
>
> Thank you.
>
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general
Re: Migrate calendars to a new server [ In reply to ]
I don’t want to export and import the whole database, only the calendars,
because the accounts and groups are different in the old and the new database!
The people using davical are the same.

Thank you very much.

> Am 14.01.2019 um 13:28 schrieb Lukas Ruf <Lukas.Ruf@lpr.ch>:
>
> Salut Petra
>
> I backuped the whole davical db and the re-imported it on the command-line as follows:
>
> #dump
>
> sudo -u postgres pg_dump --clean --encoding=UTF8 -Fc davical >${pgdump}
>
> #restore
>
> sudo -u postgres psql -f ${pgdump}
>
> # apply patches
>
> sudo -u postgres /usr/share/davical/dba/update-davical-database
>
> I was struggling for quite a long time due to character-encoding problems. Finally, I switched both -- old- and new- -- servers to UTF-8..... since then, I have not noticed any problems.
>
> wbr
>
> Lukas
>
> On 14.01.2019 12:23, Petra Humann wrote:
>> I have a running davical server, V 1.1.3.1, Debian Jessie. I want to move it to a new server
>> running Debian Stretch, davical V 1.1.7 from Backports.
>> The people are the same, but the LDAP database changes and so their accounts. Therefore I must
>> export and import the calendars. We have calendars only, no addresses.
>>
>> I’m using the command from Wiki
>> https://wiki.davical.org/index.php/Backups
>> to export the data like:
>> psql davical -Atc "SELECT array_to_string(array(SELECT caldav_data FROM caldav_data WHERE dav_name LIKE '/mark/calendar/%'),'');" > exported_calendar.ics
>>
>> After importing such an exported calendar via davical web interface the are no events in this calendar.
>> When I export this calendar via Apple iCal and import via davical web interface all is ok.
>>
>> I see the difference in phppgadmin: The entries in table „calendar_item“ are missing.
>> How do I export the table „calendar_item“ ?
>>
>> How do I export and import all calendars in an efficient way?
>>
>> Thank you.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Davical-general mailing list
>>
>> Davical-general@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/davical-general
Re: Migrate calendars to a new server [ In reply to ]
Petra,

On Mon, 14 Jan 2019, Petra Humann wrote:

> I don’t want to export and import the whole database, only the
> calendars, because the accounts and groups are different in the old and
> the new database! The people using davical are the same.
>
> Thank you very much.
>
>> Am 14.01.2019 um 13:28 schrieb Lukas Ruf <Lukas.Ruf@lpr.ch>:
>>
>> Salut Petra
>>
>> I backuped the whole davical db and the re-imported it on the
>> command-line as follows:
>>
>> #dump
>>
>> sudo -u postgres pg_dump --clean --encoding=UTF8 -Fc davical >${pgdump}
>>
>> #restore
>>
>> sudo -u postgres psql -f ${pgdump}
>>
>> # apply patches
>>
>> sudo -u postgres /usr/share/davical/dba/update-davical-database
>>
>> I was struggling for quite a long time due to character-encoding
>> problems. Finally, I switched both -- old- and new- -- servers to
>> UTF-8..... since then, I have not noticed any problems.
>>
>> On 14.01.2019 12:23, Petra Humann wrote:
>>
>>> I have a running davical server, V 1.1.3.1, Debian Jessie. I want to
>>> move it to a new server running Debian Stretch, davical V 1.1.7 from
>>> Backports. The people are the same, but the LDAP database changes and
>>> so their accounts. Therefore I must export and import the calendars.
>>> We have calendars only, no addresses.
>>>
>>> I’m using the command from Wiki
>>> https://wiki.davical.org/index.php/Backups
>>> to export the data like: psql davical -Atc "SELECT
>>> array_to_string(array(SELECT caldav_data FROM caldav_data WHERE
>>> dav_name LIKE '/mark/calendar/%'),'');" > exported_calendar.ics
>>>
>>> After importing such an exported calendar via davical web interface
>>> the are no events in this calendar. When I export this calendar via
>>> Apple iCal and import via davical web interface all is ok.
>>>
>>> I see the difference in phppgadmin: The entries in table
>>> „calendar_item“ are missing. How do I export the table „calendar_item“
>>> ?
>>>
>>> How do I export and import all calendars in an efficient way?

i had a similar problem a while ago, when i migrated my user base to LDAP
(from "native" accounts).

I worked around this with a fresh install and an import of all calendar
data (basically as Lukas described it). Afterwards i created new calendars
for my (LDAP-) users and made bindings for the respective user's old
calendars (and instructed them to use the new calendar). Since bindings
needed to be created for quite a few group calendars, this wasn't much
effort - your mileage may vary, though.

This is probably not the most elegant way, but my users accepted it and,
over time, the problem resolves itself (by old calendar data becoming
obsolete).


Mit freundlichen Gruessen/With best regards,

--Daniel.


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: Migrate calendars to a new server [ In reply to ]
Hello,

thank you for suggestions how to move from one server to a new one.
The users and calendars on the old and the new servers are the same,
but the accounts have changed from one ldap server to an other one.

Here is my procedure:

First setup the new davical server with users and groups from the new ldap server.
Create an caladmin user in the old ldap server and announce it to the old davical server
and give him all access rights.

On new server create a .netrc:
machine old.davical.server.de login caladmin password secret

Create directories:
mkdir calendars
mkdir calendars/groupX foreach group

Make a skript:

shared="/group1/cal1 /group1/cal2 /group2/cal3 /group2/cal4 /group2/cal5 …..."
#
for share in ${shared}; do
curl -s --netrc-file .netrc https://old.davical.server.de/davical/caldav.php/${share} -o calendars${share}.ics
/usr/share/davical/scripts/load_calendar.php https://new.davical.server.de replace ${share}/ calendars${share}.ics
done

# for each user
old="oldusername"
new="newusername"
curl -s --netrc-file .netrc https://old.davical.server.de/davical/caldav.php/${old}/calendar.ics -o ${old}_${new}.ics
/usr/share/davical/scripts/load_calendar.php https://new.davical.server.de replace /${new}/calendar/ ${old}_${new}.ics

Done!
You are running one host - one service, aren't you? No other user should have an account on the davical server.
Because you can run load_calendar.php as a normal user!

At the end all users must configure their clients.

Kind regards.
Petra Humann