0 Replies Latest reply: Jul 20, 2012 7:19 AM by burton11234
burton11234 Level 1 Level 1 (0 points)

This was an information article, since I spent a few hours on this one and there was no documentation and may help someone one day!

 

Description: This article was a guide on how to move a Wiki Calendar form a Lion server to another Lion Server.

 

Problem: Wiki Calendar Service wasn't running properly, and the service was stopped / restarted and never came back on. There was a few errors on our XServ regurading this, but since there was no phone support, I created a work around by migrating the data to another mini, to get calendars back up and running. This may come in handy for someone to migrate servers.

 

Another problem that came into factor here was also we upgraded from Snow Leapord, so instead of all of your files being in 1 place like they would be on a lion machine they were in multiple directories, which made the process more difficult.

 

Process: A few steps will have to be done in order for this to work. As our configuration was binded to AD, in a multi domain forest. Also remember the wiki calendars are inbended into the wiki, so not only moving the calendar files are enough to get it working on a different machine.

 

1) Bind to AD and get your 2nd machine up and running

2) Migrate the Wiki Calendars over using the KB article on apples forumn. http://support.apple.com/kb/HT5082

3) Copy the config files for the Calendar - I included the default folders for this below.

 

/Library/Server/Calendar and Contacts/Data ---> /Library/Server/Calendar and Contacts/Data on the new server

 

**note**

If you came from a snow leapord machine you will have a folder called migrated-data / .calendarserver_version files stored in a different place, once found it will have to be copied to /Library/Server/Calendar and Contacts/Documents

Both of these files need to be in this folder on the new server if your using the apple defaults ---> /Library/Server/Calendar and Contacts/Documents

 

I also had renamed my calendars-migrated to calendars-migrated-old after they were moved to the proper location.

 

The folder calendars-migrated will also have to be copied over via a USB drive since hidden attributes are embedded and any sort of network sync drops these files. (rsync / sftp) If you navigate into the calendars-migrated data, you will see filse like this with permissions drwxr-x---@ and you need to retain the @ if you have multiple calendars in 1 wiki.

 

Once the folder calendars-migrated is moved to the new location in /Library/Server/Calendar and Contacts/Documents/ you will have to use a chown to change the ownership of the permissions for the calendars-migrated folder

# sudo chown -R root:_calendar calendars-migrated

 

4) Next we will have to export the database for caldav

 

Stop the calendar / address book services

# sudo serveradmin stop calendar

# sudo serveradmin stop addressbook

 

Export the Database to the /tmp folder (file will be called caldav.pgdump)

# sudo pg_dump --format=c --compress=9 --blobs --username=caldav --file=/tmp/caldav.pgdump caldav

 

Move the file /tmp/caldav.pgdump from the old server to the new server on /tmp/caldav.pgdump.

 

One the new machine wipe the database so you can import it with the correct version (form moving the .calendarversion file over)

# sudo dropdb -U _postgres -i caldav

 

Create a new database on the new machine

# sudo createdb -U caldav caldav

 

Import that database to Collab so it can be used in the wiki

# sudo -u _postgres pg_restore -d caldav -U collab --single-transaction /tmp/caldav.pgdump


Mac OS X (10.7.3)