nlagaros

Q: need to migrate lion server caldav sql dump to mountain lion server

Here is my situation.  I was running Lion Server.  I did a postgres dump of the caldav database thinking I could re-import after doing a fresh install of Mountain Lion Server.  Obviously I was wrong, so now I'm stuck with an empty calendar and address book and all my data in this file.  Any ideas as to how I can get this data in my new system?

 

Thanks.

Mac mini Server (Mid 2010), OS X Server

Posted on Jul 30, 2012 5:00 PM

Close

Q: need to migrate lion server caldav sql dump to mountain lion server

  • All replies
  • Helpful answers

  • by Cyrus Daboo,

    Cyrus Daboo Cyrus Daboo Jul 30, 2012 8:12 PM in response to nlagaros
    Level 2 (230 points)
    Jul 30, 2012 8:12 PM in response to nlagaros

    Did you make sure that the directory GUIDs for th user on the MLion machine exactly match those from the old Lion system? The caldav server stores calendar data in the postgres database based on the user record GUIDs - so if they are different on MLion then the old data will not be seen. If that is the problem, you will need to manually edit the GUIDs for the user records you created on MLion to match the old ones. If you still have the old system try and export/importt of the user records to the new system.

  • by Yannick Rose,

    Yannick Rose Yannick Rose Jul 31, 2012 5:47 AM in response to nlagaros
    Level 1 (55 points)
    Jul 31, 2012 5:47 AM in response to nlagaros

    Like Cyrus Daboos said, make sure you have the same GUIDS for your users.

     

    Then since you already logged in with your user you have postgresSQL entrys, so you must nuke the dabase before doing an import.

     

    1. make sure you have your users with the right GUIDS

    2. Nuke the database by issuing

    sudo serveradmin stop calendar

    sudo dropdb -U _postgres caldav

    sudo calendarserver_bootstrap_database

     

     

    3. i have no tested it with lion to ML but maybe work the same as i did with 10.6 to 10.7 server, give it a try. Just place the Calendar data at the right place, make sure it has the right permissions then you can start the calendar server. Whatch the migration logs and see if it work. I had a bad time finding that solution when i manually migrated from 10.6 to 10.7

  • by nlagaros,

    nlagaros nlagaros Jul 31, 2012 5:57 AM in response to Yannick Rose
    Level 1 (0 points)
    Jul 31, 2012 5:57 AM in response to Yannick Rose

    After bootstrapping the calendar database, should I then simply use psql to restore the database?  I tried this last night and got some errors.  Is there any other migration utilitiy I should run after the import or just start the calendar and contacts servers?

  • by Yannick Rose,

    Yannick Rose Yannick Rose Jul 31, 2012 6:24 AM in response to nlagaros
    Level 1 (55 points)
    Jul 31, 2012 6:24 AM in response to nlagaros

    If it does the same process that i did with lion i would say no. The migration process should do it by itself. do backups in case it doesn't work, i'm just trying to help you shed a light with what i did on my side but i would try that if i was you.

     

     

     

     

     

    Yannick

  • by Yannick Rose,

    Yannick Rose Yannick Rose Jul 31, 2012 6:26 AM in response to Yannick Rose
    Level 1 (55 points)
    Jul 31, 2012 6:26 AM in response to Yannick Rose

    By the way, on my side it took 30-40 mins to migrate with 80 accounts. Watch the logs!

     

    And the only errors that looks bad on the logs were caused by the email gateway that was activated on the iCal server app section, disable it before starting the calendar server !!!

     

     

     

     

     

    Yannick

  • by jaydisc,

    jaydisc jaydisc Aug 3, 2012 5:26 AM in response to nlagaros
    Level 4 (1,420 points)
    Servers Enterprise
    Aug 3, 2012 5:26 AM in response to nlagaros

    The Calendar server checks the version of your database at startup and upgrades the schema as necessary. It's not like the old way with Lion where you had to put your data or documents folder at the right location. Drop the original database, create it again, restore your backup, and start 'er up.

  • by Mark Dannau,

    Mark Dannau Mark Dannau Aug 8, 2012 1:29 PM in response to jaydisc
    Level 1 (110 points)
    Aug 8, 2012 1:29 PM in response to jaydisc

    I did a clean install and want to migrate my old Caldav db that's on a external disk. I suppose that somewhere in the terminal commands I should be showing the route to the old Collaboration folder, but where should I do that?

     

    sudo serveradmin stop calendar

    sudo dropdb -U _postgres caldav

    sudo calendarserver_bootstrap_database

  • by Mark23,

    Mark23 Mark23 Sep 2, 2012 12:31 AM in response to nlagaros
    Level 3 (975 points)
    Sep 2, 2012 12:31 AM in response to nlagaros
  • by jaydisc,

    jaydisc jaydisc Sep 2, 2012 4:28 AM in response to Mark Dannau
    Level 4 (1,420 points)
    Servers Enterprise
    Sep 2, 2012 4:28 AM in response to Mark Dannau

    Migrating from what OS? if from Lion, you can actually put the former contents of  /Library/Server/Calendar/Data/Documents/ into /Library/Server/Calendar and Contacts/Data/Documents/ after running those commands and it should look for that, and upgrade it, at next startup.