sjolshag

Q: Calendar won't start after upgrade to Mountain Lion

Hi,

 

After upgrading to ML, my calendar service didn't want to start.

 

There is a "Error reading settings" message in the Server window when selecting "Calendar". Additionally, when clicking the "on" button, I get the following error:

 

The error occurred while processing a command of type 'getLocationList' in plug-in 'servermgr_calendar'.

Where do I start troubleshooting this issue?

Posted on Jul 25, 2012 1:28 PM

Close

Q: Calendar won't start after upgrade to Mountain Lion

  • All replies
  • Helpful answers

Previous Page 2 of 4 last Next
  • by ~morgen,

    ~morgen ~morgen Jul 25, 2012 5:12 PM in response to ~morgen
    Level 1 (140 points)
    Jul 25, 2012 5:12 PM in response to ~morgen

    Oh, sjolshag, perhaps there is a traceback within /Library/Logs/ServerSetup.log near the "Setup extra failed with code 1 at path:" line?

  • by sjolshag,

    sjolshag sjolshag Jul 25, 2012 5:16 PM in response to ~morgen
    Level 1 (0 points)
    Jul 25, 2012 5:16 PM in response to ~morgen

    Heh, _way_ before, yes. you're right:

     

    15:43:58.616 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/70_calendarmigrator.py

    RESULT CODE: 1

    STDOUT: calendarmigrator: Jul 25 15:43:58 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 25 15:43:58 Calendar service 'org.calendarserver.calendarserver' was previously enabled

    calendarmigrator: Jul 25 15:43:58 Addressbook service 'org.addressbookserver.addressbookserver' was previously enabled

    calendarmigrator: Jul 25 15:43:58 Examining previous caldavd.plist for EnableCalDAV and EnableCardDAV: /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 15:43:58 Based on caldavd.plist, setting EnableCalDAV to True

    calendarmigrator: Jul 25 15:43:58 Based on caldavd.plist, setting EnableCardDAV to True

    calendarmigrator: Jul 25 15:43:58 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 15:43:58 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 25 15:43:58 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 25 15:43:58 Using external calendar server root: /Library/CalendarServer/Documents/

     

     

    STDERR: Traceback (most recent call last):

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 829, in <module>

        main()

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 147, in main

        gid

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 659, in relocateData

        diskAccessor.mkdir(newDataRoot)

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 788, in mkdir

        return os.mkdir(path)

    OSError: [Errno 2] No such file or directory: '/Library/CalendarServer/Documents/Data'

     

  • by sjolshag,

    sjolshag sjolshag Jul 25, 2012 5:17 PM in response to sjolshag
    Level 1 (0 points)
    Jul 25, 2012 5:17 PM in response to sjolshag

    Appears to be missing the entire directory structure for /Library/CalendarServer

  • by sjolshag,

    sjolshag sjolshag Jul 25, 2012 5:19 PM in response to ~morgen
    Level 1 (0 points)
    Jul 25, 2012 5:19 PM in response to ~morgen

    calendarmigrator: Jul 25 15:43:58 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 25 15:43:58 Calendar service 'org.calendarserver.calendarserver' was previously enabled

    calendarmigrator: Jul 25 15:43:58 Addressbook service 'org.addressbookserver.addressbookserver' was previously enabled

    calendarmigrator: Jul 25 15:43:58 Examining previous caldavd.plist for EnableCalDAV and EnableCardDAV: /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 15:43:58 Based on caldavd.plist, setting EnableCalDAV to True

    calendarmigrator: Jul 25 15:43:58 Based on caldavd.plist, setting EnableCardDAV to True

    calendarmigrator: Jul 25 15:43:58 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 15:43:58 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 25 15:43:58 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 25 15:43:58 Using external calendar server root: /Library/CalendarServer/Documents/

  • by ~morgen,

    ~morgen ~morgen Jul 25, 2012 5:49 PM in response to sjolshag
    Level 1 (140 points)
    Jul 25, 2012 5:49 PM in response to sjolshag

    Well, /Library/CalendarServer/ was the Snow Leopard directory; in Lion and Mountain Lion it's /Library/Server/Calendar and Contacts/.  Was this a Snow Leopard server before?  If so, the upgrade to Lion should have relocated /Library/CalendarServer/ to /Library/Server/Calendar and Contacts/.  Perhaps you could describe the upgrade/migration "history" of this particular server, so I can piece together why it's in the current state.

  • by sjolshag,

    sjolshag sjolshag Jul 25, 2012 6:04 PM in response to ~morgen
    Level 1 (0 points)
    Jul 25, 2012 6:04 PM in response to ~morgen

    I'm racking my brain, but I _think_ (for a short amount of time) it started as a Snow Leopard Server which was upgraded to a Lion Server & now (attempted) upgraded to a Mountain Lion Server....

     

    But I'm, honestly, a little fuzzy on the inital startingpoint. It could have been a Snow Leopard Server when I bought it (mini), but I'm not 100% sure either way.

  • by davidcmn,

    davidcmn davidcmn Jul 25, 2012 9:51 PM in response to sjolshag
    Level 1 (5 points)
    Jul 25, 2012 9:51 PM in response to sjolshag

    I am having the same problem.  My server was updated from snow leopar --> lion --> mountain lion

  • by CeesBerrens,

    CeesBerrens CeesBerrens Jul 25, 2012 11:27 PM in response to ~morgen
    Level 1 (0 points)
    Jul 25, 2012 11:27 PM in response to ~morgen

    Hi,

    I've the same problem and my MacMini Server mid 2011 was a fresh Lion server install.

  • by ~morgen,

    ~morgen ~morgen Jul 25, 2012 11:39 PM in response to CeesBerrens
    Level 1 (140 points)
    Jul 25, 2012 11:39 PM in response to CeesBerrens

    In this thread there are two separate problems, so we need to establish which one you are running into, davidcmn and CeesBerrens. 

     

    noben's problem is that Swedish is not supported. 

     

    sjolshag apparently has a directory structure the migration script doesn't understand, and I'm looking into that one.

     

    CeesBerrens and davidcmn:  please look in the following logs for errors:

     

    /Library/Logs/ServerSetup.log

    /Library/Logs/Migration/calendarmigrator.log

  • by davidcmn,

    davidcmn davidcmn Jul 25, 2012 11:49 PM in response to ~morgen
    Level 1 (5 points)
    Jul 25, 2012 11:49 PM in response to ~morgen

    From ServerSetup.log

     

    22:25:22.214 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-snmpconfigmigrator.pl

    RESULT CODE: 0

    STDOUT:

    STDERR: launchctl: Error unloading: org.net-snmp.snmpd

     

    22:26:32.448 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/65_mail_migrator.pl

    RESULT CODE: 0

    STDOUT:

    STDERR: /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: /etc/postfix/master.cf: unused parameter: fallback_relay=

    1+0 records in

    1+0 records out

    256 bytes transferred in 0.000063 secs (4067204 bytes/sec)

    Print: Entry, ":imap:notification_server_enabled", Does Not Exist

    2012-07-25 22:25:33.924 serveradmin[2242:707] servermgr_mail: postconf read error: /usr/sbin/postconf: warning: /Library/Server/Mail/Config/postfix/master.cf: unused parameter: fallback_relay=

    2012-07-25 22:25:35.385 serveradmin[2250:707] servermgr_mail: postconf read error: /usr/sbin/postconf: warning: /Library/Server/Mail/Config/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: //Library/Server/Mail/Config/postfix/master.cf: unused parameter: fallback_relay=

    /usr/sbin/postconf: warning: //Library/Server/Mail/Config/postfix/master.cf: unused parameter: fallback_relay=

    2012-07-25 22:25:41.406 serveradmin[2279:707] servermgr_mail: postconf read error: /usr/sbin/postconf: warning: /Library/Server/Mail/Config/postfix/master.cf: unused parameter: fallback_relay=

    2012-07-25 22:25:43.465 serveradmin[2287:707] servermgr_mail: postconf read error: /usr/sbin/postconf: warning: /Library/Server/Mail/Config/postfix/master.cf: unused parameter: fallback_relay=

    cp: /Library/Server/Previous/var/spool/imap/dovecot/mail/*: No such file or directory

    chown: //var/spool/imap/dovecot/mail: No such file or directory

    Add: ":Disabled" Entry Already Exists

    Add: ":RunAtLoad" Entry Already Exists

    Add: ":Label" Entry Already Exists

    Add: ":Program" Entry Already Exists

    Add: ":ProgramArguments" Entry Already Exists

     

    22:26:33.256 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/70_calendarmigrator.py

    RESULT CODE: 1

    STDOUT: calendarmigrator: Jul 25 22:26:33 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 25 22:26:33 Couldn't determine previous state of calendar service 'org.calendarserver.calendarserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.calendarserver.calend arserver.plist exist

    calendarmigrator: Jul 25 22:26:33 Couldn't determine previous state of addressbook service 'org.addressbookserver.addressbookserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.addressbookserver.add ressbookserver.plist exist

    calendarmigrator: Jul 25 22:26:33 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 22:26:33 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 25 22:26:33 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 25 22:26:33 Using external calendar server root: /Library/CalendarServer/Documents/

     

     

    STDERR: Traceback (most recent call last):

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 829, in <module>

        main()

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 147, in main

        gid

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 659, in relocateData

        diskAccessor.mkdir(newDataRoot)

      File "/Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrat ionExtras/70_calendarmigrator.py", line 788, in mkdir

        return os.mkdir(path)

    OSError: [Errno 2] No such file or directory: '/Library/CalendarServer/Documents/Data'

     

    22:46:00.142 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-snmpconfigmigrator.pl

    RESULT CODE: 0

    STDOUT:

    STDERR: launchctl: Error unloading: org.net-snmp.snmpd

  • by davidcmn,

    davidcmn davidcmn Jul 25, 2012 11:50 PM in response to davidcmn
    Level 1 (5 points)
    Jul 25, 2012 11:50 PM in response to davidcmn

    Below is my calendarmigrator.log

     

    calendarmigrator: Jul 20 17:16:54 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Previous System', 'sourceVersion': '10.6.8', 'purge': '1'}

    calendarmigrator: Jul 20 17:16:54 Calendar service 'org.calendarserver.calendarserver' was previously disabled

    calendarmigrator: Jul 20 17:16:54 Addressbook service 'org.addressbookserver.addressbookserver' was previously disabled

    calendarmigrator: Jul 20 17:16:54 ServerIDs from /private/etc/caldavd/caldavd.plist: 93, 93

    calendarmigrator: Jul 20 17:16:54 Found previous caldavd plist at /Previous System/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 20 17:16:54 Found previous carddavd plist at /Previous System/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 20 17:16:54 RelocateData: sourceRoot=/Previous System, targetRoot=/, oldServerRootValue=None, oldCalDocumentRootValue=/Library/CalendarServer/Documents/, oldCalDataRootValue=/Library/CalendarServer/Data/, oldABDocumentRootValue=/Library/AddressBookServer/Documents, uid=93, gid=93

    calendarmigrator: Jul 20 17:16:54 Copying configuration files from /Previous System/private/etc/caldavd to /private/etc/caldavd

    calendarmigrator: Jul 20 17:16:54 Copying file /Previous System/private/etc/caldavd/sudoers.plist to /private/etc/caldavd

    calendarmigrator: Jul 20 17:16:54 Copying configuration files from /Previous System/private/etc/carddavd to /private/etc/caldavd

    calendarmigrator: Jul 20 17:16:54 Processing /Previous System/private/etc/caldavd/caldavd.plist and /Previous System/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 20 17:16:54 Writing /private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 20 17:16:54 Configuring notifications via serveradmin

    calendarmigrator: Jul 20 17:16:56 serveradmin exited with 0

    calendarmigrator: Jul 20 17:16:56 Creating resource migration trigger file: /Library/Server/Calendar and Contacts/trigger_resource_migration

    calendarmigrator: Jul 25 22:26:33 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 25 22:26:33 Couldn't determine previous state of calendar service 'org.calendarserver.calendarserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.calendarserver.calend arserver.plist exist

    calendarmigrator: Jul 25 22:26:33 Couldn't determine previous state of addressbook service 'org.addressbookserver.addressbookserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.addressbookserver.add ressbookserver.plist exist

    calendarmigrator: Jul 25 22:26:33 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 22:26:33 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 25 22:26:33 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 25 22:26:33 Using external calendar server root: /Library/CalendarServer/Documents/

    calendarmigrator: Jul 25 22:47:08 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 25 22:47:08 Couldn't determine previous state of calendar service 'org.calendarserver.calendarserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.calendarserver.calend arserver.plist exist

    calendarmigrator: Jul 25 22:47:08 Couldn't determine previous state of addressbook service 'org.addressbookserver.addressbookserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.addressbookserver.add ressbookserver.plist exist

    calendarmigrator: Jul 25 22:47:08 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 22:47:08 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 25 22:47:08 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 25 22:47:08 Using external calendar server root: /Library/CalendarServer/Documents/

    calendarmigrator: Jul 25 23:14:10 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 25 23:14:10 Couldn't determine previous state of calendar service 'org.calendarserver.calendarserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.calendarserver.calend arserver.plist exist

    calendarmigrator: Jul 25 23:14:10 Couldn't determine previous state of addressbook service 'org.addressbookserver.addressbookserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.addressbookserver.add ressbookserver.plist exist

    calendarmigrator: Jul 25 23:14:10 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 25 23:14:10 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 25 23:14:10 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 25 23:14:10 Using external calendar server root: /Library/CalendarServer/Documents/

    calendarmigrator: Jul 26 01:18:53 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 26 01:18:53 Couldn't determine previous state of calendar service 'org.calendarserver.calendarserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.calendarserver.calend arserver.plist exist

    calendarmigrator: Jul 26 01:18:53 Couldn't determine previous state of addressbook service 'org.addressbookserver.addressbookserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.addressbookserver.add ressbookserver.plist exist

    calendarmigrator: Jul 26 01:18:53 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 26 01:18:53 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 26 01:18:53 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 26 01:18:53 Using external calendar server root: /Library/CalendarServer/Documents/

    calendarmigrator: Jul 26 01:34:41 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 26 01:34:41 Couldn't determine previous state of calendar service 'org.calendarserver.calendarserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.calendarserver.calend arserver.plist exist

    calendarmigrator: Jul 26 01:34:41 Couldn't determine previous state of addressbook service 'org.addressbookserver.addressbookserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.addressbookserver.add ressbookserver.plist exist

    calendarmigrator: Jul 26 01:34:41 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 26 01:34:41 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 26 01:34:41 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 26 01:34:41 Using external calendar server root: /Library/CalendarServer/Documents/

    calendarmigrator: Jul 26 01:38:08 Options: {'targetRoot': '/', 'sourceType': 'System', 'language': 'en', 'sourceRoot': '/Library/Server/Previous', 'sourceVersion': '10.7.4', 'purge': '0'}

    calendarmigrator: Jul 26 01:38:08 Couldn't determine previous state of calendar service 'org.calendarserver.calendarserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.calendarserver.calend arserver.plist exist

    calendarmigrator: Jul 26 01:38:08 Couldn't determine previous state of addressbook service 'org.addressbookserver.addressbookserver': Neither /Library/Server/Previous/var/db/launchd.db/com.apple.launchd/overrides.plist nor /Library/Server/Previous/System/Library/LaunchDaemons/org.addressbookserver.add ressbookserver.plist exist

    calendarmigrator: Jul 26 01:38:08 Found previous caldavd plist at /Library/Server/Previous/private/etc/caldavd/caldavd.plist

    calendarmigrator: Jul 26 01:38:08 Can't find previous carddavd plist at /Library/Server/Previous/private/etc/carddavd/carddavd.plist

    calendarmigrator: Jul 26 01:38:08 RelocateData: sourceRoot=/Library/Server/Previous, targetRoot=/, oldServerRootValue=/Library/CalendarServer/Documents/, oldCalDocumentRootValue=Documents, oldCalDataRootValue=Data, oldABDocumentRootValue=None, uid=93, gid=93

    calendarmigrator: Jul 26 01:38:08 Using external calendar server root: /Library/CalendarServer/Documents/

  • by CeesBerrens,

    CeesBerrens CeesBerrens Jul 26, 2012 1:47 AM in response to ~morgen
    Level 1 (0 points)
    Jul 26, 2012 1:47 AM in response to ~morgen

    Server setup log:

    22:20:02.425 local KDC set up

    22:20:11.512 Beginning setup migration extras

    22:20:11.513 Debug mode enabled: NO

    22:20:12.643 25 jul. 2012

    22:20:12.644 Mac OS X 10.8 (12A269)

    22:20:12.644 Server 2.0.23 (12S307)

    22:20:12.645 Starting extras with arguments:

      --sourceRoot /Library/Server/Previous --targetRoot / --purge 0 --language nl --sourceVersion 10.7.4 --sourceType System

    22:20:13.537 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/001-migrationExtraServerRestore.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6, 10.7 or 10.8). Since we support migration from 10.6-10.8.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:20:15.312 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/01_PostgreSQLSetup.rb

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:20:38.446 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/05_postgresmigrator.rb

    RESULT CODE: 0

    STDOUT:

    STDERR:

    WARNING: enabling "trust" authentication for local connections

    You can change this by editing pg_hba.conf or using the -A option the

    next time you run initdb.

    psql:/Library/Server/PostgreSQL/Migration/pg_upgrade_dump_db.sql:3884: WARNING:  => is deprecated as an operator name

    DETAIL:  This name may be disallowed altogether in future versions of PostgreSQL.

     

     

     

     

    22:20:38.480 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/20_nfsconfigmigrator.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:20:38.584 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-afctlmigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.5.8 or 10.6). Since we support migration from 10.5, 10.6,

                      and other 10.7 installs, it's useful to know this information, and it would be easier for me to figure

                      it out once and pass it on to each script than to have each script have to figure it out itself.

    --targetRoot <path> The path to the root of the new system. Pretty much always "/"

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way.

     

     

     

    STDERR:

     

     

    22:20:38.640 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-ftpconfigmigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6, 10.7 or 10.8). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:20:38.740 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-ipfwmigrator

    RESULT CODE: 0

    STDOUT:

    STDERR: 2012-07-25 22:20:38.698 30-ipfwmigrator[3245:707] user6Rules == nil path = /Library/Server/Previous//private/etc/ipfilter//ip6fw.conf

    2012-07-25 22:20:38.735 30-ipfwmigrator[3245:707] Saving merged rules file...

    2012-07-25 22:20:38.737 30-ipfwmigrator[3245:707] Saving merged IPv6 rules file...

     

     

     

     

    22:20:38.798 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-natconfigmigrator.pl

    RESULT CODE: 1

    STDOUT: --targetRoot is the key for value /

    --sourceRoot is the key for value /Library/Server/Previous

    --purge is the key for value 1

    --sourceVersion is the key for value 10.7.4

    --sourceType is the key for value System

    --language is the key for value nl

    sourceVersion := 10.7.4

    Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6 or 10.7). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR: sh: : No such file or directory

     

     

     

     

    22:20:38.836 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-Network-migration.sh

    RESULT CODE: 0

    STDOUT: NetworkMigration: SourceRoot = "/Library/Server/Previous"

    NetworkMigration: TargetRoot = "/"

    NetworkMigration: SourceConfigPath = "/Library/Server/Previous/private/etc/nat/autoportmap.plist"

    NetworkMigration: TargetConfigLocation = "//Library/Server/Network/Config/"

    NetworkMigration: copying "/Library/Server/Previous/private/etc/nat/autoportmap.plist" to "//Library/Server/Network/Config/"

     

     

    STDERR:

     

     

    22:20:38.930 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-serverperflogconfigmigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system, 10.7.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:20:39.036 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-snmpconfigmigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6, 10.7 or 10.8). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:20:39.105 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/30-xsannotificationsmigrator.pl

    RESULT CODE: 1

    STDOUT: --targetRoot is the key for value /

    --sourceRoot is the key for value /Library/Server/Previous

    --purge is the key for value 1

    --sourceVersion is the key for value 10.7.4

    --sourceType is the key for value System

    --language is the key for value nl

    sourceVersion := 10.7.4

    Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6, 10.7 or 10.8). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:20:39.184 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/50-vpnconfigmigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6 or 10.7). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:20:39.282 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/58_jabbermigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6.x or 10.7). Since we support migration from 10.6,

                      10.7, and other 10.8 installs, it's useful to know this information, and it would be easier for me to figure

                      it out once and pass it on to each script than to have each script have to figure it out itself.

    --targetRoot <path> The path to the root of the new system. Pretty much always "/"

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:21:06.777 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/58_webconfigmigrator.rb

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:06.982 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/60_swupdateconfigmigrator

    RESULT CODE: 0

    STDOUT: swupdate:upgradeStatus = 0

     

     

    STDERR:

     

     

    22:21:07.019 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/62_wikiCreatorMigrator

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:07.392 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/65_mail_migrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6.7 or 10.7). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:21:09.744 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/70_calendarmigrator.py

    RESULT CODE: 2

    STDOUT:

    STDERR: Usage: 70_calendarmigrator.py [options]

     

     

    70_calendarmigrator.py: error: option --language: invalid choice: 'nl' (choose from 'en', 'fr', 'de', 'ja')

     

     

     

     

    22:21:09.840 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/80-devicemgrmigration.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:10.864 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/80_radiusconfigmigrator.pl

    RESULT CODE: 0

    STDOUT: 80_radiusconfigmigrator.pl: Migrating RADIUS configuration...

    80_radiusconfigmigrator.pl: Migrating certificate parameters into eap.conf...

    80_radiusconfigmigrator.pl: RADIUS migration complete

     

     

    STDERR: 80_radiusconfigmigrator.pl: command failed: /usr/sbin/radiusconfig -getconfigxml "/Library/Server/Previous/private/etc/raddb" 1> /var/tmp/radxml.yIzVyI

     

     

     

     

    22:21:11.105 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/95-migrate_netboot.pl

    RESULT CODE: 0

    STDOUT: 95-migrate_netboot.pl: Migrating DHCP and NetBoot configuration...

    95-migrate_netboot.pl: migrating etc/bootpd.plist

    95-migrate_netboot.pl: migrating private/tftpboot

    95-migrate_netboot.pl: DHCP is disabled for all interfaces

    95-migrate_netboot.pl: netboot_enabled not found in bootpd.plist

    95-migrate_netboot.pl: DHCP and NetBoot are both disabled in //etc/bootpd.plist: not loading //System/Library/LaunchDaemons/bootps.plist

    95-migrate_netboot.pl: DHCP and NetBoot migration complete

     

     

    STDERR:

     

     

    22:21:20.592 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/98-wikimigrator.rb

    RESULT CODE: 0

    STDOUT:

    STDERR: Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:61 751b7180 +18ms] -[PGCConnection connect] with [user=collab dbname=collab]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:320 751b7180 +6ms] Executing update [SET bytea_output TO escape]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [BEGIN]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +2ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +3ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:148 751b7180 +0ms] Updating schema...

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:233 751b7180 +0ms] Executing query [SELECT * FROM entity_acls WHERE entity_uid_fk = '19A307C1-82BC-45C7-845A-21839FB222C7']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [CSConfig:54 751b7180 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +1ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +32ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/15.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE entity ADD COLUMN theme_name varchar;

              UPDATE entity_type SET fields = fields || hstore('theme_name', 'themeName') WHERE name = 'com.apple.Entity';

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +2ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  15

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:118 751b7180 +0ms] Executing migration block #16

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:360 751b7180 +0ms] Adding blogGUID to the entity table...

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:233 751b7180 +0ms] Executing query [ALTER TABLE entity ADD COLUMN blog_uid_fk uuid]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:233 751b7180 +0ms] Executing query [UPDATE entity_type SET fields = fields || hstore('blog_uid_fk', 'blogGUID'), field_refs = field_refs || hstore('blogGUID', 'com.apple.entity.Blog') WHERE name = 'com.apple.Entity']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:233 751b7180 +0ms] Executing query [SELECT uid, ownedby_uid_fk FROM entity WHERE is_blog_enabled = true]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  16

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/17.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE entity_changesets DROP COLUMN change_delta;

              CREATE TABLE user_activity (user_uid_fk uuid NOT NULL, action varchar NOT NULL, entity_uid_fk uuid NOT NULL, entity_revision int NOT NULL, data bytea, action_time timestamp NOT NULL DEFAULT now());

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +37ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  17

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/18.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE user_activity ADD parent_uids uuid[];

              UPDATE user_activity ua SET parent_uids=(SELECT parent_uids::uuid[] FROM entity WHERE uid=ua.entity_uid_fk);

              ALTER TABLE user_activity ALTER parent_uids SET NOT NULL;

              CREATE INDEX idx_useractivity_parents ON user_activity(parent_uids);

              CREATE INDEX idx_useractivity_user ON user_activity(user_uid_fk);

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +52ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  18

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/19.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE entity ADD banner_image_uid_fk uuid;

              UPDATE entity_type SET fields = fields || hstore('banner_image_uid_fk','bannerImageGUID'), field_refs = field_refs || hstore('bannerImageGUID', 'com.apple.entity.FileData') WHERE name='com.apple.Entity';

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  19

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/20.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE search_index ADD entity_type_fk varchar;

              UPDATE search_index SET entity_type_fk=(SELECT entity_type_fk FROM entity WHERE uid=entity_uid_fk);

              ALTER TABLE search_index ALTER entity_type_fk SET NOT NULL;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  20

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/21.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE entity ADD container_uid_fk uuid REFERENCES entity(uid);

              ALTER TABLE entity DISABLE TRIGGER USER;

              UPDATE entity

              SET container_uid_fk=(

                        SELECT e2.uid

                        FROM entity e2

                        WHERE e2.uid=ANY(entity.parent_uids::uuid[])

                        AND e2.entity_type_fk IN ('com.apple.entity.Project', 'com.apple.entity.User', 'com.apple.entity.Blog')

                        ORDER BY position(e2.uid::text in array_to_string(entity.parent_uids, ',')) DESC

                        LIMIT 1

              ) WHERE container_uid_fk IS NULL;

              ALTER TABLE entity ENABLE TRIGGER USER;

              CREATE INDEX idx_entity_container_uid_fk ON entity(container_uid_fk);

              ALTER TABLE user_activity ADD container_uid_fk uuid;

              UPDATE user_activity SET container_uid_fk=( SELECT e2.container_uid_fk FROM entity e2 WHERE e2.uid=user_activity.entity_uid_fk ) WHERE container_uid_fk IS NULL;

              CREATE INDEX idx_user_activity_container_uid_fk ON user_activity(container_uid_fk);

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +8ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  21

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/22.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              UPDATE entity_type SET fields = fields || hstore('container_uid_fk','containerGUID') WHERE name='com.apple.Entity';

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  22

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/23.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE OR REPLACE FUNCTION trg_update_entity_parents() RETURNS trigger AS $trg_update_entity_parents$

                  BEGIN

                      IF TG_OP='UPDATE' THEN

                        IF NEW.parent_uids IS NOT NULL AND OLD.ownedby_uid_fk=NEW.ownedby_uid_fk THEN

                          RETURN NEW;

                        END IF;

                      END IF;

     

                      NEW.owner_entity_type_fk := (SELECT entity_type_fk FROM entity parent_entity_record WHERE NEW.ownedby_uid_fk = parent_entity_record.uid);

     

                      NEW.parent_uids := calculate_entity_parents(NEW.uid, NEW.ownedby_uid_fk);

     

                      UPDATE entity

                         SET parent_uids=NEW.parent_uids||ARRAY[uid::varchar]

                       WHERE uid <> NEW.uid

                         AND ownedby_uid_fk = NEW.uid;

     

                      NEW.container_uid_fk := (

                                SELECT e2.uid

                                  FROM entity e2

                                 WHERE e2.uid::varchar=ANY(NEW.parent_uids)

                                   AND e2.entity_type_fk IN ('com.apple.entity.Project', 'com.apple.entity.User', 'com.apple.entity.Blog')

                              ORDER BY position(e2.uid::text in array_to_string(NEW.parent_uids, ',')) DESC

                                 LIMIT 1

                          );

     

                      RETURN NEW;

                  END;

              $trg_update_entity_parents$ LANGUAGE plpgsql;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  23

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/24.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE TABLE preview_queue (entity_uid_fk uuid NOT NULL REFERENCES entity(uid), entity_url_path varchar);

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  24

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/25.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE entity ADD preview_uid_fk uuid;

              UPDATE entity_type SET fields = fields || hstore('preview_uid_fk','previewGUID'), field_refs = field_refs || hstore('previewGUID', 'com.apple.entity.FileData') WHERE name='com.apple.Entity';

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  25

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/26.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE search_index ADD is_deleted boolean;

              UPDATE search_index SET is_deleted=(SELECT is_deleted FROM entity WHERE uid=entity_uid_fk);

              ALTER TABLE search_index ALTER is_deleted SET NOT NULL;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  26

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/27.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE preview_queue ADD session_uid_fk uuid;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  27

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/28.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP TABLE search_results;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  28

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/29.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE OR REPLACE FUNCTION uniquify_filename(_longname varchar) RETURNS varchar AS $uniquify_filename$

                  DECLARE

                    _m text[];

                  BEGIN

                    SELECT INTO _m * FROM regexp_matches(_longname, E'-([0-9]+)\\.([^\\.]+)$') LIMIT 1;

                    IF _m IS NOT NULL THEN

                      RETURN regexp_replace(_longname, E'-([0-9]+)\\.([^\\.]+)$', '-'||((_m[1]::int+1)::text)||'.'||_m[2]);

                    END IF;

     

                    SELECT INTO _m * FROM regexp_matches(_longname, E'-([0-9]+)$') LIMIT 1;

                    IF _m IS NOT NULL THEN

                      RETURN regexp_replace(_longname, E'-([0-9]+)$', '-'||((_m[1]::int+1)::text));

                    END IF;

     

                    SELECT INTO _m * FROM regexp_matches(_longname, E'\\.([^\\.]+)$') LIMIT 1;

                    IF _m IS NOT NULL THEN

                      RETURN regexp_replace(_longname, E'\\.([^\\.]+)$', E'-2.\\1');

                    END IF;

     

                    RETURN _longname || '-2';

                  END;

              $uniquify_filename$ LANGUAGE plpgsql IMMUTABLE;

     

              CREATE INDEX idx_entity_filename ON entity(long_name) WHERE entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted;

     

              CREATE TABLE filename_reservation ( unused boolean );

     

              CREATE OR REPLACE FUNCTION trg_update_entity_filename() RETURNS trigger AS $trg_update_entity_filename$

                  DECLARE

                    _safetynet int;

                  BEGIN

                      IF NEW.entity_type_fk <> 'com.apple.entity.File' THEN

                          RETURN NEW;

                      END IF;

     

                      -- IF TG_OP='UPDATE' THEN  

                      --   IF NEW.long_name IS NOT NULL AND OLD.long_name=NEW.long_name THEN 

                      --     RETURN NEW; 

                      --   END IF;   

                      -- END IF; 

     

                      _safetynet := 50;

     

                      LOCK TABLE filename_reservation IN EXCLUSIVE MODE;

                      WHILE _safetynet > 0 AND EXISTS (SELECT true FROM entity WHERE uid <> NEW.uid AND long_name=NEW.long_name AND entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted LIMIT 1) LOOP

                          NEW.long_name := uniquify_filename(NEW.long_name);

                          _safetynet := _safetynet-1;

                      END LOOP;

     

                      RETURN NEW;

                  END;

              $trg_update_entity_filename$ LANGUAGE plpgsql;

     

              CREATE TRIGGER update_entity_filename

               BEFORE INSERT OR UPDATE ON entity

               FOR EACH ROW

               EXECUTE PROCEDURE trg_update_entity_filename();

     

              UPDATE entity SET long_name=long_name WHERE entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted;

     

              DROP INDEX idx_entity_filename;

              CREATE UNIQUE INDEX idx_entity_filename ON entity(long_name) WHERE entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted;

     

              CREATE OR REPLACE FUNCTION trg_update_entity_filename() RETURNS trigger AS $trg_update_entity_filename$

                  DECLARE

                    _safetynet int;

                  BEGIN

                      IF NEW.entity_type_fk <> 'com.apple.entity.File' THEN

                          RETURN NEW;

                      END IF;

     

                      IF TG_OP='UPDATE' THEN  

                        IF NEW.long_name IS NOT NULL AND OLD.long_name=NEW.long_name THEN 

                          RETURN NEW; 

                        END IF;   

                      END IF; 

     

                      _safetynet := 50;

     

                      LOCK TABLE filename_reservation IN EXCLUSIVE MODE;

                      WHILE _safetynet > 0 AND EXISTS (SELECT true FROM entity WHERE uid <> NEW.uid AND long_name=NEW.long_name AND entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted LIMIT 1) LOOP

                          NEW.long_name := uniquify_filename(NEW.long_name);

                          _safetynet := _safetynet-1;

                      END LOOP;

     

                      RETURN NEW;

                  END;

              $trg_update_entity_filename$ LANGUAGE plpgsql;

     

              DROP TRIGGER update_entity_filename ON entity;

              CREATE TRIGGER update_entity_filename

               BEFORE INSERT OR UPDATE ON entity

               FOR EACH ROW

               EXECUTE PROCEDURE trg_update_entity_filename();

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +4ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  29

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/30.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE OR REPLACE FUNCTION trg_update_entity_filename() RETURNS trigger AS $trg_update_entity_filename$

                  DECLARE

                    _safetynet int;

                  BEGIN

                      IF NEW.entity_type_fk <> 'com.apple.entity.File' THEN

                          RETURN NEW;

                      END IF;

     

                      IF TG_OP='UPDATE' THEN

                        IF NEW.long_name IS NOT NULL AND OLD.long_name=NEW.long_name THEN

                          RETURN NEW;

                        END IF;

                      END IF;

     

                      _safetynet := 50;

     

                      LOCK TABLE filename_reservation IN EXCLUSIVE MODE;

                      WHILE _safetynet > 0 AND EXISTS (SELECT true FROM entity WHERE uid <> NEW.uid AND long_name=NEW.long_name AND entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted LIMIT 1) LOOP

                          NEW.long_name := uniquify_filename(NEW.long_name);

                          _safetynet := _safetynet-1;

                      END LOOP;

     

                      RETURN NEW;

                  END;

              $trg_update_entity_filename$ LANGUAGE plpgsql;

     

              DROP TRIGGER update_entity_filename ON entity;

              CREATE TRIGGER update_entity_filename

               BEFORE INSERT OR UPDATE ON entity

               FOR EACH ROW

               EXECUTE PROCEDURE trg_update_entity_filename();

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  30

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/31.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE entity RENAME theme_name TO theme_info;

              UPDATE entity_type SET fields=(fields - 'theme_name'::text)||hstore('theme_info','themeInfo') WHERE name='com.apple.Entity';

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  31

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/32.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP TABLE IF EXISTS entity_tag;

              DROP TABLE IF EXISTS entity_tags;

              CREATE TABLE entity_tag (

                  entity_uid_fk       uuid NOT NULL,

                  tags                varchar[] NOT NULL DEFAULT '{}'

              );

              CREATE INDEX idx_entity_tag_tags ON entity_tag(tags);

              INSERT INTO entity_tag SELECT uid, tags FROM entity;

              ALTER TABLE entity DROP tags;

              UPDATE entity_type SET fields=(fields-'tags'::text) WHERE name='com.apple.Entity';

              ]

    NOTICE:  table "entity_tag" does not exist, skipping

    NOTICE:  table "entity_tags" does not exist, skipping

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  32

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/33.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE UNIQUE INDEX idx_entity_tag_entity ON entity_tag(entity_uid_fk);

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  33

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/34.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE TABLE entity_preview (

                  entity_uid_fk       uuid NOT NULL PRIMARY KEY REFERENCES entity(uid),

                  preview_uid_fk      uuid NOT NULL

              );

     

              INSERT INTO entity_preview SELECT uid, preview_uid_fk FROM entity WHERE preview_uid_fk IS NOT NULL;

              UPDATE entity_type SET fields=(fields-'preview_uid_fk'::text) WHERE name='com.apple.Entity';

              ALTER TABLE entity DROP preview_uid_fk;

              ]

    NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "entity_preview_pkey" for table "entity_preview"

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +2ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  34

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/35.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP TABLE IF EXISTS serverhome_guids;

              CREATE TEMP TABLE serverhome_guids ON COMMIT DROP AS

              WITH serverhomeu AS (SELECT uid FROM entity WHERE tiny_id='serverhomeu' AND NOT is_perm_deleted)

              SELECT uid, entity_type_fk AS type

                FROM entity

               WHERE (container_uid_fk=(SELECT uid FROM serverhomeu) OR

                      parent_uids BETWEEN ARRAY[(SELECT uid FROM serverhomeu)]::varchar[] AND (ARRAY[(SELECT uid FROM serverhomeu)]||ARRAY[NULL::uuid])::varchar[])

                 AND 1=(SELECT revision FROM entity WHERE tiny_id='serverhome' AND NOT is_perm_deleted)

              ;

     

              DELETE FROM search_index WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_acls WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM preview_queue WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM relationship WHERE source_uid_fk IN (SELECT uid FROM serverhome_guids) OR target_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_comment WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM notification WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM subscription WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_activity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_favorites WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_read_status WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_watched WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_updates WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_lock WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_changesets WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_private_attrs WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_attrs WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_tag WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

     

              DELETE FROM session WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_activity WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_favorites WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_read_status WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_watched WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_updates WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

     

              DELETE FROM file_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.File');

              DELETE FROM filedata_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.FileData');

              DELETE FROM page_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.Page');

              DELETE FROM user_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM document_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type IN ('com.apple.entity.Page', 'com.apple.entity.File'));

              DELETE FROM blog_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.Blog');

              DELETE FROM entity_preview WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity WHERE uid IN (SELECT uid FROM serverhome_guids);

              ]

    NOTICE:  table "serverhome_guids" does not exist, skipping

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +25ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=7

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  35

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/36.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              UPDATE entity e

                 SET blog_uid_fk=(SELECT uid FROM entity b WHERE b.ownedby_uid_fk=e.uid AND b.entity_type_fk='com.apple.entity.Blog' LIMIT 1)

               WHERE e.blog_uid_fk IS NULL

                 AND (e.entity_type_fk='com.apple.entity.User' OR e.entity_type_fk='com.apple.entity.Project')

              ;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=2

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  36

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/37.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              ALTER TABLE entity DROP banner_image_uid_fk;

              UPDATE entity_type SET fields=(fields - 'banner_image_uid_fk'::text), field_refs=(field_refs - 'bannerImageGUID'::text) WHERE name='com.apple.Entity';

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  37

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/38.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE INDEX idx_user_activity_user_time ON user_activity(user_uid_fk, action_time DESC);

              CREATE INDEX idx_user_activity_container_time ON user_activity(container_uid_fk, action_time DESC);

              CREATE INDEX idx_entity_type ON entity(entity_type_fk);

              CREATE TYPE last_activity AS (user_uid_fk uuid, action_time timestamp);

     

              DROP INDEX idx_user_activity_container_uid_fk;

              DROP INDEX idx_useractivity_user;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  38

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/39.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              UPDATE entity_acls SET external_id=regexp_replace(external_id,'^groups:(.+)', E'\\1') WHERE external_id LIKE 'groups:%';

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  39

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/40.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE INDEX idx_user_activity_action_time ON user_activity(action_time DESC);

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  40

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/41.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP FUNCTION IF EXISTS uuid_v4();

              CREATE FUNCTION uuid_v4() RETURNS uuid AS $uuid_v4$

              BEGIN

                  RETURN lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') || '-' ||

                         '4' || to_hex((random()*15)::int)::text ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') || '-' ||

                         (ARRAY['8','9','a','b'])[1 + floor(4*random())] || to_hex((random()*15)::int)::text ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') || '-' ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') || '-' ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0') ||

                         lpad(to_hex((random()*255)::int)::text,2,'0');

              END;

              $uuid_v4$ LANGUAGE plpgsql;

     

              INSERT INTO entity (uid, tiny_id, entity_type_fk, is_hidden, long_name, short_name, createdby_user_fk, updatedby_user_fk, ownedby_uid_fk, container_uid_fk)

                   SELECT uuid_v4(), ue.tiny_id||'blog', 'com.apple.entity.Blog', true, ue.long_name, ue.short_name, ue.uid, ue.uid, ue.uid, ue.uid

                     FROM entity ue

                    WHERE entity_type_fk='com.apple.entity.User'

                      AND blog_uid_fk IS NULL

              ;

     

              UPDATE entity

                SET blog_uid_fk=(SELECT e.uid FROM entity e WHERE e.entity_type_fk='com.apple.entity.Blog' AND e.ownedby_uid_fk=entity.uid LIMIT 1)

              WHERE entity_type_fk='com.apple.entity.User'

                AND blog_uid_fk IS NULL

              ;

     

              INSERT INTO blog_entity (entity_uid_fk) SELECT uid FROM entity WHERE entity_type_fk='com.apple.entity.Blog' AND uid NOT IN (SELECT entity_uid_fk FROM blog_entity);

     

              ]

    NOTICE:  function uuid_v4() does not exist, skipping

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +5ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=2

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  41

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/42.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP TRIGGER update_changeset_moddates ON entity_changesets;

              DROP FUNCTION trg_update_changeset_moddates();

              DROP TRIGGER update_comment_moddates ON entity_comment;

              DROP FUNCTION trg_update_comment_moddates();

     

              UPDATE entity_type SET fields=((fields - 'child_update_time'::text) - 'child_updatedby_user_fk'::text) WHERE name='com.apple.Entity';

              ALTER TABLE entity DROP child_update_time;

              ALTER TABLE entity DROP child_updatedby_user_fk;

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  42

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/43.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              -- Make file/filedata constraints deferrable so that we can batch FileEntity/FileDataEntity creation during file upload without getting caught by the circular reference.

              UPDATE pg_constraint SET condeferrable='t' WHERE conname='filedata_entity_icon_uid_fk_fkey';

              UPDATE pg_trigger SET tgdeferrable = 't' WHERE tgconstraint=(SELECT oid FROM pg_constraint WHERE conname='filedata_entity_icon_uid_fk_fkey');

              UPDATE pg_constraint SET condeferrable='t' WHERE conname='file_entity_data_uid_fk_fkey';

              UPDATE pg_trigger SET tgdeferrable = 't' WHERE tgconstraint=(SELECT oid FROM pg_constraint WHERE conname='file_entity_data_uid_fk_fkey');

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=4

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  43

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +7ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/44.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              -- Relax constraints for project creation.

              UPDATE pg_constraint SET condeferrable='t' WHERE conname='project_entity_detail_page_fk_fkey';

              UPDATE pg_trigger SET tgdeferrable = 't' WHERE tgconstraint=(SELECT oid FROM pg_constraint WHERE conname='project_entity_detail_page_fk_fkey');

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=4

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  44

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/45.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE INDEX idx_user_activity_entity_time ON user_activity(entity_uid_fk, action_time DESC);

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +11ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  45

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/46.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE INDEX idx_searchindex_numcontent ON search_index(cast(content as numeric)) where content similar to '[0-9]+';

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +18ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  46

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/47.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP INDEX idx_search_index_literal;

              CREATE INDEX idx_search_index_literal ON search_index(substring(content,1,1000));

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +16ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  47

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/48.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              INSERT INTO user_activity (user_uid_fk, action, entity_uid_fk, entity_revision, action_time, parent_uids, container_uid_fk)

                  SELECT cs.change_user_fk AS user_uid_fk,

                         CASE cs.change_type

                           WHEN 'create' THEN 'com.apple.activity.EntityCreated'

                           WHEN 'edit' THEN 'com.apple.activity.EntityUpdated'

                         END AS action,

                         cs.entity_uid_fk,

                         cs.entity_revision,

                         cs.change_time AS action_time,

                         e.parent_uids::uuid[],

                         e.container_uid_fk

                    FROM entity_changesets cs

                      LEFT OUTER JOIN entity e ON (e.uid=cs.entity_uid_fk)

                   WHERE cs.change_type IN ('create', 'edit')

                     AND e.uid IS NOT NULL

                     AND cs.change_user_fk NOT IN (SELECT uid FROM entity WHERE entity_type_fk='com.apple.entity.User' and short_name='serverhomeu')

                     AND NOT (cs.entity_uid_fk IN (SELECT entity_uid_fk FROM page_entity WHERE is_detail_page) AND cs.change_type='create')

                     AND e.entity_type_fk IN ('com.apple.entity.Page', 'com.apple.entity.File', 'com.apple.entity.Project')

              ;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  48

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/49.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP FUNCTION IF EXISTS trg_update_entity_parents() CASCADE;

              CREATE FUNCTION trg_update_entity_parents() RETURNS trigger AS $trg_update_entity_parents$

              BEGIN

                  IF TG_OP='UPDATE' THEN

                    IF NEW.parent_uids IS NOT NULL AND NEW.container_uid_fk IS NOT NULL AND OLD.ownedby_uid_fk=NEW.ownedby_uid_fk THEN

                      RETURN NEW;

                    END IF;

                  END IF;

     

                  NEW.owner_entity_type_fk := (SELECT entity_type_fk FROM entity parent_entity_record WHERE NEW.ownedby_uid_fk = parent_entity_record.uid);

                  NEW.parent_uids := calculate_entity_parents(NEW.uid, NEW.ownedby_uid_fk);

     

                  UPDATE entity

                     SET parent_uids=NEW.parent_uids||ARRAY[uid::varchar]

                   WHERE uid <> NEW.uid

                     AND ownedby_uid_fk = NEW.uid;

     

                  NEW.container_uid_fk := (

                            SELECT e2.uid

                              FROM entity e2

                             WHERE e2.uid::varchar=ANY(NEW.parent_uids) AND e2.uid <> NEW.uid

                               AND e2.entity_type_fk IN ('com.apple.entity.Project', 'com.apple.entity.User', 'com.apple.entity.Blog')

                          ORDER BY position(e2.uid::text in array_to_string(NEW.parent_uids, ',')) DESC

                             LIMIT 1

                      );

     

                  RETURN NEW;

              END;

              $trg_update_entity_parents$ LANGUAGE plpgsql;

              CREATE TRIGGER update_entity_parents BEFORE INSERT OR UPDATE ON entity FOR EACH ROW EXECUTE PROCEDURE trg_update_entity_parents();

     

              CREATE TEMP TABLE working_uids_49 ON COMMIT DROP AS SELECT uid FROM entity WHERE uid=container_uid_fk;

              UPDATE entity SET parent_uids=NULL WHERE uid IN (SELECT uid FROM working_uids_49) AND uid=container_uid_fk;

     

              ]

    NOTICE:  drop cascades to trigger update_entity_parents on table entity

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +5ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=2

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  49

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/50.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP INDEX IF EXISTS idx_entity_tag_tags;

              CREATE INDEX idx_entity_tag_tags ON entity_tag(tags) WHERE tags IS NOT NULL AND tags <> '{}'::varchar[];

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  50

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/51.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DELETE FROM user_activity WHERE entity_uid_fk IN (SELECT uid FROM entity WHERE entity_type_fk not IN ('com.apple.entity.Page', 'com.apple.entity.File', 'com.apple.entity.Project'));

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  51

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/52.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE TEMP TABLE orphaned_detail_page_uids (uid uuid) ON COMMIT DROP;

     

              INSERT INTO orphaned_detail_page_uids

                  SELECT p.detail_page_fk

                    FROM entity pe

                      LEFT OUTER JOIN project_entity p ON (p.entity_uid_fk=pe.uid)

                      LEFT OUTER JOIN page_entity dp ON (dp.entity_uid_fk=p.detail_page_fk)

                      LEFT OUTER JOIN entity dpe ON (dpe.uid=p.detail_page_fk)

                   WHERE p.detail_page_fk IS NOT NULL

                     AND pe.entity_type_fk='com.apple.entity.Project'

                     AND NOT dp.is_detail_page

                     AND pe.uid=dpe.container_uid_fk

              ;

     

              INSERT INTO orphaned_detail_page_uids

                  SELECT u.detail_page_fk

                    FROM entity ue

                      LEFT OUTER JOIN user_entity u ON (u.entity_uid_fk=ue.uid)

                      LEFT OUTER JOIN page_entity dp ON (dp.entity_uid_fk=u.detail_page_fk)

                      LEFT OUTER JOIN entity dpe ON (dpe.uid=u.detail_page_fk)

                   WHERE u.detail_page_fk IS NOT NULL

                     AND ue.entity_type_fk='com.apple.entity.User'

                     AND NOT dp.is_detail_page

                     AND ue.uid=dpe.container_uid_fk

              ;

     

              UPDATE page_entity SET is_detail_page=true WHERE entity_uid_fk IN (SELECT uid FROM orphaned_detail_page_uids);

              UPDATE entity SET revision=revision+1 WHERE uid IN (SELECT uid FROM orphaned_detail_page_uids);

     

              SET bytea_output TO escape;

     

              CREATE TEMP TABLE orphaned_detail_page_revs_to_bump ON COMMIT DROP AS

                SELECT uid

                  FROM entity_changesets

                 WHERE entity_uid_fk IN (SELECT uid FROM orphaned_detail_page_uids)

                   AND entity_revision > 1

              ;

     

              UPDATE entity_changesets

                 SET entity_revision=entity_revision+1

               WHERE uid IN (SELECT uid FROM orphaned_detail_page_revs_to_bump)

              ;

     

              INSERT INTO entity_changesets (uid, entity_uid_fk, entity_revision, change_user_fk, change_action, change_type, change_fields, change_time, change_data_bin)

                   SELECT uuid_v4(),

                          o.uid,

                          2,

                          oe.updatedby_user_fk,

                          'UPDATE',

                          'system-fixdetailpage',

                          ARRAY['isDetailPage'],

                          clock_timestamp(),

                          'gaxpc0RldGFpbFBhZ2XD' /* This is base64-encoded MsgPack for { isDetailPage => true } */

                     FROM orphaned_detail_page_uids o

                       LEFT OUTER JOIN entity oe ON (o.uid=oe.uid)

              ;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +4ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  52

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:118 751b7180 +0ms] Executing migration block #53

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:233 751b7180 +0ms] Executing query [SELECT entity_uid_fk, data_uri FROM filedata_entity WHERE data_uri LIKE E'%\\%%']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  53

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/54.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP FUNCTION IF EXISTS trg_update_entity_parents() CASCADE;

              CREATE FUNCTION trg_update_entity_parents() RETURNS trigger AS $trg_update_entity_parents$

              BEGIN

                  IF TG_OP='UPDATE' THEN

                    IF NEW.parent_uids IS NOT NULL AND NEW.container_uid_fk IS NOT NULL AND OLD.ownedby_uid_fk=NEW.ownedby_uid_fk THEN

                      RETURN NEW;

                    END IF;

                  END IF;

     

                  NEW.owner_entity_type_fk := (SELECT entity_type_fk FROM entity parent_entity_record WHERE NEW.ownedby_uid_fk = parent_entity_record.uid);

                  NEW.parent_uids := calculate_entity_parents(NEW.uid, NEW.ownedby_uid_fk);

     

                  UPDATE entity

                     SET parent_uids=NEW.parent_uids||ARRAY[uid::varchar]

                   WHERE uid <> NEW.uid

                     AND ownedby_uid_fk = NEW.uid;

     

                  NEW.container_uid_fk := (

                            SELECT e2.uid

                              FROM entity e2

                             WHERE e2.uid::varchar=ANY(NEW.parent_uids) AND e2.uid <> NEW.uid

                               AND e2.entity_type_fk IN ('com.apple.entity.Project', 'com.apple.entity.User')

                          ORDER BY position(e2.uid::text in array_to_string(NEW.parent_uids, ',')) DESC

                             LIMIT 1

                      );

     

                  RETURN NEW;

              END;

              $trg_update_entity_parents$ LANGUAGE plpgsql;

              CREATE TRIGGER update_entity_parents BEFORE INSERT OR UPDATE ON entity FOR EACH ROW EXECUTE PROCEDURE trg_update_entity_parents();

     

              CREATE TEMP TABLE working_uids_54 ON COMMIT DROP AS SELECT uid FROM entity WHERE container_uid_fk IN (SELECT uid FROM entity WHERE entity_type_fk='com.apple.entity.Blog');

              UPDATE entity SET container_uid_fk=NULL WHERE uid IN (SELECT uid FROM working_uids_54) AND container_uid_fk IN (SELECT uid FROM entity WHERE entity_type_fk='com.apple.entity.Blog');

     

              ]

    NOTICE:  drop cascades to trigger update_entity_parents on table entity

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +2ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  54

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/55.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE LOCAL TEMP TABLE x_ents_to_hide ON COMMIT DROP AS

                SELECT uid

                  FROM entity

                 WHERE entity_type_fk='com.apple.entity.User'

                   AND short_name in ('authenticated', 'unauthenticated', 'serverhomeu')

              ;

     

              UPDATE entity SET is_hidden=true WHERE uid IN (SELECT uid FROM x_ents_to_hide) OR container_uid_fk IN (SELECT uid FROM x_ents_to_hide) OR ownedby_uid_fk IN (SELECT uid FROM x_ents_to_hide);

     

              DELETE FROM search_index WHERE entity_uid_fk IN (SELECT uid FROM x_ents_to_hide);

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  55

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/56.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DELETE FROM user_activity WHERE entity_uid_fk IN (SELECT uid FROM entity WHERE entity_type_fk='com.apple.entity.Blog');

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  56

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/57.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE TABLE search_stat (

                  uid                 uuid NOT NULL,

     

                  action              varchar NOT NULL,

                  action_time         timestamp NOT NULL DEFAULT clock_timestamp(),

                  user_uid_fk         uuid NOT NULL,

     

                  query_text          varchar,

                  sort_text           varchar,

                  range               int[],

     

                  result_index        int,

                  result_uid_fk       uuid,

                  result_snippets     hstore

              );

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +17ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  57

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:118 751b7180 +0ms] Executing migration block #58

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:205 751b7180 +0ms] Executing query [INSERT INTO session (uid, user_uid_fk, auth_token) SELECT uuid_v4(), entity_uid_fk, $1 FROM user_entity WHERE external_id='unauthenticated' RETURNING uid] with params [(

                  "pkOEoSzOIeS7HglOPNUxlCfTg5I/m/+2+On3SrMC1Zc="

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [INSERT INTO preview_queue (entity_uid_fk, session_uid_fk) SELECT entity_uid_fk, $1 FROM page_entity] with params [(

                  "55365b12-499a-ac40-147c-8b7699782657"

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  58

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/59.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP TEXT SEARCH CONFIGURATION IF EXISTS english_nostop;

              DROP TEXT SEARCH DICTIONARY IF EXISTS english_nostop;

              CREATE TEXT SEARCH DICTIONARY public.english_nostop (template=pg_catalog.snowball, language=english);

              CREATE TEXT SEARCH CONFIGURATION english_nostop (copy=pg_catalog.english);

              ALTER TEXT SEARCH CONFIGURATION english_nostop ALTER MAPPING FOR asciiword, asciihword, hword_asciipart, word, hword, hword_part WITH english_nostop, english_stem;

              ALTER DATABASE collab SET default_text_search_config=english_nostop;

              ]

    NOTICE:  text search configuration "english_nostop" does not exist, skipping

    NOTICE:  text search dictionary "english_nostop" does not exist, skipping

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  59

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/60.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE TABLE user_readall_time (

                  user_uid_fk     uuid PRIMARY KEY REFERENCES user_entity(entity_uid_fk),

                  readall_time    timestamp NOT NULL DEFAULT now()

              );

     

              CREATE TEMP TABLE temp_readall AS

                SELECT DISTINCT ON (user_uid_fk) user_uid_fk, read_time

                  FROM user_entity_read_status u

              GROUP BY user_uid_fk, read_time

                HAVING count(*) > 1

              ORDER BY user_uid_fk, read_time DESC

              ;

     

              INSERT INTO user_readall_time (user_uid_fk, readall_time) SELECT user_uid_fk, read_time FROM temp_readall;

              DELETE FROM user_entity_read_status WHERE ARRAY[user_uid_fk::text, read_time::text] IN (SELECT ARRAY[user_uid_fk::text, read_time::text] FROM temp_readall);

              ]

    NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "user_readall_time_pkey" for table "user_readall_time"

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +8ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  60

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/61.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              UPDATE entity_acls SET external_id=replace(external_id, 'group:group:', 'group:') WHERE external_id LIKE 'group:group:';

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  61

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/62.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE TABLE user_entity_unread_status (

                  user_uid_fk         uuid NOT NULL REFERENCES user_entity(entity_uid_fk),

                  entity_uid_fk       uuid NOT NULL REFERENCES entity(uid),

                  unread_time         timestamp NOT NULL DEFAULT now()

              );

     

              CREATE INDEX idx_ueus_user ON user_entity_unread_status(user_uid_fk);

              CREATE INDEX idx_ueus_entity ON user_entity_unread_status(entity_uid_fk);

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +11ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  62

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/63.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DELETE FROM user_activity

               WHERE user_uid_fk=(SELECT uid FROM entity WHERE entity_type_fk='com.apple.entity.User' and short_name='serverhomeu')

                 AND action='com.apple.activity.EntityCreated'

              ;

     

              DELETE FROM user_activity

               WHERE entity_uid_fk IN (SELECT entity_uid_fk FROM page_entity WHERE is_detail_page)

                 AND action='com.apple.activity.EntityCreated'

              ;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  63

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/64.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              /*

               * Migration #66 needs to be run for #64 to work, copying it here. It will run again as #66, harmlessly.

               */

     

              CREATE OR REPLACE FUNCTION trg_update_entity_filename() RETURNS trigger AS $trg_update_entity_filename$

                  DECLARE

                    _safetynet int;

                  BEGIN

                      IF NEW.entity_type_fk <> 'com.apple.entity.File' THEN

                          RETURN NEW;

                      END IF;

     

                      IF TG_OP='UPDATE' THEN

                        IF NEW.long_name IS NOT NULL AND OLD.long_name=NEW.long_name AND NEW.is_hidden=OLD.is_hidden AND NEW.is_deleted=OLD.is_deleted THEN

                          RETURN NEW;

                        END IF;

                      END IF;

     

                      _safetynet := 50;

     

                      LOCK TABLE filename_reservation IN EXCLUSIVE MODE;

                      WHILE _safetynet > 0 AND EXISTS (SELECT true FROM entity WHERE uid <> NEW.uid AND long_name=NEW.long_name AND entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted LIMIT 1) LOOP

                          NEW.long_name := uniquify_filename(NEW.long_name);

                          _safetynet := _safetynet-1;

                      END LOOP;

     

                      RETURN NEW;

                  END;

              $trg_update_entity_filename$ LANGUAGE plpgsql;

     

              DROP TRIGGER update_entity_filename ON entity;

              CREATE TRIGGER update_entity_filename

               BEFORE INSERT OR UPDATE ON entity

               FOR EACH ROW

               EXECUTE PROCEDURE trg_update_entity_filename();

     

              /*

               * End migration #66

               */

     

              SET bytea_output TO escape;

     

              UPDATE entity_changesets

                 SET change_type='unhide'

               WHERE change_fields=ARRAY['isHidden']

                 AND change_type <> 'unhide'

                 AND change_data_bin='gahpc0hpZGRlbsI=' -- Base64-encoded MsgPack for { isHidden => false }

              ;

     

              UPDATE entity_changesets

                 SET change_type='hide'

               WHERE change_fields=ARRAY['isHidden']

                 AND change_type <> 'hide'

                 AND change_data_bin='gahpc0hpZGRlbsM=' -- Base64-encoded MsgPack for { isHidden => true }

              ;

     

     

              CREATE TEMP TABLE hidden_uids ON COMMIT DROP AS

              SELECT DISTINCT ON (entity_uid_fk) entity_uid_fk, change_data_bin

                FROM entity_changesets

                  LEFT OUTER JOIN entity ON (entity.uid=entity_uid_fk)

               WHERE change_fields='{isHidden}'

                 AND entity.entity_type_fk IN ('com.apple.entity.File','com.apple.entity.Page')

                 AND NOT entity.owner_entity_type_fk IN ('com.apple.entity.User','com.apple.entity.Blog')

              ORDER BY entity_uid_fk, change_time DESC

              ;

     

              UPDATE entity

                 SET is_hidden=false, revision=revision+1

               WHERE uid IN (SELECT entity_uid_fk FROM hidden_uids WHERE change_data_bin='gahpc0hpZGRlbsM=')

              ;

     

              INSERT INTO entity_changesets (uid, entity_uid_fk, entity_revision, change_user_fk, change_action, change_type, change_fields, change_time, change_data_bin)

                   SELECT uuid_v4(),

                          hu.entity_uid_fk,

                          he.revision,

                          he.updatedby_user_fk,

                          'UPDATE',

                          'system-fixhidden',

                          ARRAY['isHidden'],

                          clock_timestamp(),

                          'gahpc0hpZGRlbsI='

                     FROM hidden_uids hu

                       LEFT OUTER JOIN entity he ON (hu.entity_uid_fk=he.uid)

                    WHERE hu.change_data_bin='gahpc0hpZGRlbsM='

              ;

     

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  64

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/65.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              DROP TABLE IF EXISTS serverhome_guids;

              CREATE TEMP TABLE serverhome_guids ON COMMIT DROP AS

              WITH serverhomeu AS (SELECT uid FROM entity WHERE tiny_id='serverhomeu' AND NOT is_perm_deleted)

              SELECT uid, entity_type_fk AS type

                FROM entity

               WHERE (container_uid_fk=(SELECT uid FROM serverhomeu) OR

                      parent_uids BETWEEN ARRAY[(SELECT uid FROM serverhomeu)]::varchar[] AND (ARRAY[(SELECT uid FROM serverhomeu)]||ARRAY[NULL::uuid])::varchar[])

                 AND 1=(SELECT revision FROM entity WHERE tiny_id='serverhome' AND NOT is_perm_deleted)

              ;

     

              DELETE FROM search_index WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_acls WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM preview_queue WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM relationship WHERE source_uid_fk IN (SELECT uid FROM serverhome_guids) OR target_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_comment WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM notification WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM subscription WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_activity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_favorites WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_read_status WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_watched WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM user_entity_updates WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_lock WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_changesets WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_private_attrs WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_attrs WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity_tag WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

     

              DELETE FROM session WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_activity WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_favorites WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_read_status WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_watched WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM user_entity_updates WHERE user_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

     

              DELETE FROM file_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.File');

              DELETE FROM filedata_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.FileData');

              DELETE FROM page_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.Page');

              DELETE FROM user_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.User');

              DELETE FROM document_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type IN ('com.apple.entity.Page', 'com.apple.entity.File'));

              DELETE FROM blog_entity WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids WHERE type='com.apple.entity.Blog');

              DELETE FROM entity_preview WHERE entity_uid_fk IN (SELECT uid FROM serverhome_guids);

              DELETE FROM entity WHERE uid IN (SELECT uid FROM serverhome_guids);

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +6ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  65

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/66.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE OR REPLACE FUNCTION trg_update_entity_filename() RETURNS trigger AS $trg_update_entity_filename$

                  DECLARE

                    _safetynet int;

                  BEGIN

                      IF NEW.entity_type_fk <> 'com.apple.entity.File' THEN

                          RETURN NEW;

                      END IF;

     

                      IF TG_OP='UPDATE' THEN

                        IF NEW.long_name IS NOT NULL AND OLD.long_name=NEW.long_name AND NEW.is_hidden=OLD.is_hidden AND NEW.is_deleted=OLD.is_deleted THEN

                          RETURN NEW;

                        END IF;

                      END IF;

     

                      _safetynet := 50;

     

                      LOCK TABLE filename_reservation IN EXCLUSIVE MODE;

                      WHILE _safetynet > 0 AND EXISTS (SELECT true FROM entity WHERE uid <> NEW.uid AND long_name=NEW.long_name AND entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted LIMIT 1) LOOP

                          NEW.long_name := uniquify_filename(NEW.long_name);

                          _safetynet := _safetynet-1;

                      END LOOP;

     

                      RETURN NEW;

                  END;

              $trg_update_entity_filename$ LANGUAGE plpgsql;

     

              DROP TRIGGER update_entity_filename ON entity;

              CREATE TRIGGER update_entity_filename

               BEFORE INSERT OR UPDATE ON entity

               FOR EACH ROW

               EXECUTE PROCEDURE trg_update_entity_filename();

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  66

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/67.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              UPDATE entity e

                 SET blog_uid_fk=(SELECT uid FROM entity b WHERE b.ownedby_uid_fk=e.uid AND b.entity_type_fk='com.apple.entity.Blog' LIMIT 1)

               WHERE e.blog_uid_fk IS NULL

                 AND (e.entity_type_fk='com.apple.entity.User' OR e.entity_type_fk='com.apple.entity.Project')

              ;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  67

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/68.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              UPDATE entity e

                 SET blog_uid_fk=(SELECT uid FROM entity b WHERE b.ownedby_uid_fk=e.uid AND b.entity_type_fk='com.apple.entity.Blog' LIMIT 1)

               WHERE (e.blog_uid_fk IS NULL OR e.blog_uid_fk=e.uid)

                 AND (e.entity_type_fk='com.apple.entity.User' OR e.entity_type_fk='com.apple.entity.Project')

              ;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  68

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:106 751b7180 +0ms] Executing migration SQL script /Applications/Server.app/Contents/ServerRoot/usr/share/collabd/server/sql/migra tions/69.sql

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [/**

               * Copyright (c) 2010-2012, Apple Inc. All rights reserved.

               *

               * IMPORTANT NOTE: This file is licensed only for use on Apple-branded

               * computers and is subject to the terms and conditions of the Apple Software

               * License Agreement accompanying the package this file is a part of.

               * You may not port this file to another platform without Apple's written consent.

               *

               * IMPORTANT NOTE: This file is licensed only for use with the Wiki Server feature

               * of the Apple Software and is subject to the terms and conditions of the Apple

               * Software License Agreement accompanying the package this file is part of.

               **/

     

              CREATE OR REPLACE FUNCTION trg_update_entity_filename() RETURNS trigger AS $trg_update_entity_filename$

                  DECLARE

                    _safetynet int;

                  BEGIN

                      IF NEW.entity_type_fk <> 'com.apple.entity.File' THEN

                          RETURN NEW;

                      END IF;

     

                      IF TG_OP='UPDATE' THEN

                        IF NEW.long_name IS NOT NULL AND OLD.long_name=NEW.long_name AND NEW.is_hidden=OLD.is_hidden AND NEW.is_deleted=OLD.is_deleted THEN

                          RETURN NEW;

                        END IF;

                      END IF;

     

                      _safetynet := 50;

     

                      LOCK TABLE filename_reservation IN EXCLUSIVE MODE;

                      WHILE _safetynet > 0 AND EXISTS (SELECT true FROM entity WHERE uid <> NEW.uid AND long_name=NEW.long_name AND entity_type_fk='com.apple.entity.File' AND NOT is_hidden AND NOT is_deleted LIMIT 1) LOOP

                          NEW.long_name := uniquify_filename(NEW.long_name);

                          _safetynet := _safetynet-1;

                      END LOOP;

     

                      NEW.short_name := uniquify_filename(NEW.short_name);

     

                      RETURN NEW;

                  END;

              $trg_update_entity_filename$ LANGUAGE plpgsql;

     

              DROP TRIGGER update_entity_filename ON entity;

              CREATE TRIGGER update_entity_filename

               BEFORE INSERT OR UPDATE ON entity

               FOR EACH ROW

               EXECUTE PROCEDURE trg_update_entity_filename();

     

              UPDATE entity

                 SET short_name=long_name

               WHERE entity_type_fk='com.apple.entity.File'

                 AND (short_name IS NULL OR short_name <> long_name)

              ;

              ]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:289 751b7180 +0ms] Executing update [UPDATE global_settings SET value_int = $1 WHERE key = 'com.apple.setting.schema_version'] with params [(

                  69

              )]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT true FROM pg_attribute WHERE attrelid='global_settings'::regclass AND attname='value_int']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT value_int FROM global_settings WHERE key = 'com.apple.setting.schema_version']

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:442 751b7180 +0ms] Schema updates completed.

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [COMMIT]

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +10ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Info>: [SchemaMigrator:449 751b7180 +0ms] Database changed, performing a VACUUM FULL ANALYZE

    Jul 25 22:21:18 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [VACUUM FULL ANALYZE]

    Jul 25 22:21:19 macserver.local wikiadmin[3565] <Debug>: [PGCConnection:181 751b7180 +822ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Info>: [MigrationController:702 751b7180 +8ms] Rebuilding search index...

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:61 751b7180 +0ms] -[PGCConnection connect] with [user=collab dbname=collab]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:320 751b7180 +7ms] Executing update [SET bytea_output TO escape]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:233 751b7180 +0ms] Executing query [SELECT true FROM entity WHERE false]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_TUPLES_OK] rows returned=0/updated=0

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Info>: [CSConfig:54 751b7180 +23ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [CSConnectionPool:95 751b7180 +0ms] Opening DB connection

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:61 751b7180 +0ms] -[PGCConnection connect] with [dbname=collab application_name=wikiadmin client_encoding=utf-8 options='-c bytea_output=escape' user=collab]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:233 751b7180 +3ms] Executing query [SELECT oid FROM pg_type WHERE typname='hstore']

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:388 751b7180 +0ms] Executing scalar query [SELECT array_agg(uid::varchar) FROM entity]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_TUPLES_OK] rows returned=1/updated=1

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [CREATE TABLE search_index_scratch_20120725T222119 AS SELECT * FROM search_index LIMIT 0]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +3ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=0

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [CSWorkerPool:151 751b7180 +151ms] All workers finished, continuing

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [BEGIN]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:456 751b7180 +0ms] Executing count query [SELECT true FROM search_index_scratch_20120725T222119 LIMIT 1]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_TUPLES_OK] rows returned=0/updated=0

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Info>: [CSPGSearchService:338 751b7180 +0ms] No rows in search_index_scratch_20120725T222119, leaving existing search_index alone.

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [DROP TABLE search_index_scratch_20120725T222119]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +1ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [COMMIT]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +21ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [SET maintenance_work_mem TO '1GB']

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +0ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:320 751b7180 +0ms] Executing update [VACUUM FULL ANALYZE search_index]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:181 751b7180 +52ms] Query result is [PGRES_COMMAND_OK] rows returned=0/updated=

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [CSConnectionPool:291 751b7180 +0ms] Closing DB connection

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:469 751b7180 +0ms] -[PGCConnection close]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Debug>: [PGCConnection:469 751b7180 +0ms] -[PGCConnection close]

    Jul 25 22:21:19 macserver.local wikiadmin[3567] <Info>: [MigrationController:728 751b7180 +0ms] Done

     

     

     

     

    22:21:20.945 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/99-wiki_config_migrator.py

    RESULT CODE: 0

    STDOUT: Maximum verbosity

    Merged //Applications/Server.app/Contents/ServerRoot/private/etc/collabd/collabd.plist .default and /Library/Server/Previous/private/etc/collabd/collabd.plist into //Library/Server/Wiki/Config/collabd.plist

    Merged //Applications/Server.app/Contents/ServerRoot/private/etc/collabd/collabcored.p list.default and /Library/Server/Previous/private/etc/collabd/collabcored.plist into //Library/Server/Wiki/Config/collabcored.plist

    Source path: /Library/Server/Previous/private/etc/collabd/filter_whitelist.plist doesn't exist

    Merged //Applications/Server.app/Contents/ServerRoot/private/etc/collabd/webauthd.plis t.default and /Library/Server/Previous/private/etc/collabd/webauthd.plist into //Library/Server/Wiki/Config/webauthd.plist

    Got status for wiki from serveradmin as wiki:state = "STOPPED"

     

     

    Wiki is not running ... skipping

     

     

    STDERR:

     

     

    22:21:21.038 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/111-alfconfigmigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6 or 10.7). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:21:21.093 Setup extra failed:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/111-syslogconfigmigrator.pl

    RESULT CODE: 1

    STDOUT: Did not supply a valid language for the --language parameter, needs to be one of [en|fr|de|ja]

    --purge <0 | 1>   "1" means remove any files from the old system after you've migrated them, "0" means leave them alone.

    --sourceRoot <path> The path to the root of the system to migrate

    --sourceType <System | TimeMachine> Gives the type of the migration source, whether it's a runnable system or a

                      Time Machine backup.

    --sourceVersion <ver> The version number of the old system (like 10.6 or 10.7). Since we support migration from 10.6, 10.7,

                      and other 10.8 installs.

    --targetRoot <path> The path to the root of the new system.

    --language <lang> A language identifier, such as "en." Long running scripts should return a description of what they're doing

                      ("Migrating Open Directory users"), and possibly provide status update messages along the way. These messages

                      need to be localized (which is not necessarily the server running the migration script).

                      This argument will identify the Server Assistant language. As an alternative to doing localization yourselves

                      send them in English, but in case the script will do this it will need this identifier.

     

     

     

    STDERR:

     

     

    22:21:21.109 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/MigrationUtilities.pm

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:23.874 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/UpdateDefaultGroup.sh

    RESULT CODE: 0

    STDOUT: accounts:attributes:dsAttrTypeStandard\:RecordType:_array_index:0 = "dsRecTypeStandard:Groups"

    accounts:attributes:dsAttrTypeStandard\:RecordName:_array_index:0 = "workgroup"

    accounts:attributes:dsAttrTypeStandard\:GeneratedUID:_array_index:0 = "F597ADA5-9238-46B8-8999-8DD27BAEB24C"

    accounts:attributes:dsAttrTypeStandard\:NestedGroups:_array_index:0 = "ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000003D"

    accounts:attributes:dsAttrTypeStandard\:AppleMetaRecordName:_array_index:0 = "cn=workgroup,cn=groups,dc=macserver,dc=local"

    accounts:attributes:dsAttrTypeStandard\:AppleMetaNodeLocation:_array_index:0 = "/LDAPv3/127.0.0.1"

     

     

    STDERR: 2012-07-25 22:21:23.824 serveradmin[3620:707] servermgr_calendar: checkMailAccessForServiceUser did not find a user

    2012-07-25 22:21:23.825 serveradmin[3620:707] getting service list

    2012-07-25 22:21:23.851 serveradmin[3620:707] NSScanner: nil string argument

    2012-07-25 22:21:23.852 serveradmin[3620:707] NSScanner: nil string argument

     

     

     

     

    22:21:24.493 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/UpgradeUsers

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:24.505 Starting extras with arguments:

     

    22:21:24.788 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/30-serverTuning.sh

    RESULT CODE: 0

    STDOUT: 12300 allow tcp from any to any established

    12301 allow ip from any to any proto tcp out

    12302 allow tcp from any to any dst-port 22

    12302 allow udp from any to any dst-port 22

    12303 allow udp from any to any dst-port 68

    12304 allow udp from any to any out keep-state

    12305 allow tcp from any to any dst-port 53 out keep-state

    12305 allow ip from any to any proto udp dst-port 53 out keep-state

    12306 allow udp from any to any in frag

    12307 allow tcp from any to any dst-port 311

    12308 allow tcp from any to any dst-port 625

    12309 allow icmp from any to any icmptypes 8

    12310 allow icmp from any to any icmptypes 0

    12311 allow igmp from any to any

    01000 allow ip from any to any via lo0

    01010 deny ip from any to 127.0.0.0/8

    01020 deny ip from 224.0.0.0/4 to any in

    01030 deny tcp from any to 224.0.0.0/4 in

    65534 deny ip from any to any

    net.inet.ip.fw.enable: 1 -> 0

    01000 allow ipv6 from any to any via lo0

    01100 allow ipv6 from any to ff02::/16

    65000 deny ipv6 from any to any

    net.inet6.ip6.fw.enable: 1 -> 0

    net.inet.tcp.delayed_ack: 3 -> 2

     

     

    STDERR:

     

     

    22:21:24.920 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/60-setup_alerts.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:25.103 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/61-setup_amavisd.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:25.177 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/62-setup_spamassassin.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:26.635 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/63-setup_clamav.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:27.954 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/65-setup_dovecot.sh

    RESULT CODE: 0

    STDOUT: conf.d/10-auth.conf -> ../conf.d/10-auth.conf

    conf.d/10-director.conf -> ../conf.d/10-director.conf

    conf.d/10-logging.conf -> ../conf.d/10-logging.conf

    conf.d/10-mail.conf -> ../conf.d/10-mail.conf

    conf.d/10-master.conf -> ../conf.d/10-master.conf

    conf.d/10-ssl.conf -> ../conf.d/10-ssl.conf

    conf.d/15-lda.conf -> ../conf.d/15-lda.conf

    conf.d/20-imap.conf -> ../conf.d/20-imap.conf

    conf.d/20-lmtp.conf -> ../conf.d/20-lmtp.conf

    conf.d/20-managesieve.conf -> ../conf.d/20-managesieve.conf

    conf.d/20-pop3.conf -> ../conf.d/20-pop3.conf

    conf.d/90-acl.conf -> ../conf.d/90-acl.conf

    conf.d/90-plugin.conf -> ../conf.d/90-plugin.conf

    conf.d/90-quota.conf -> ../conf.d/90-quota.conf

    conf.d/90-sieve.conf -> ../conf.d/90-sieve.conf

    conf.d/auth-checkpassword.conf.ext -> ../conf.d/auth-checkpassword.conf.ext

    conf.d/auth-deny.conf.ext -> ../conf.d/auth-deny.conf.ext

    conf.d/auth-ldap.conf.ext -> ../conf.d/auth-ldap.conf.ext

    conf.d/auth-master.conf.ext -> ../conf.d/auth-master.conf.ext

    conf.d/auth-od.conf.ext -> ../conf.d/auth-od.conf.ext

    conf.d/auth-passwdfile.conf.ext -> ../conf.d/auth-passwdfile.conf.ext

    conf.d/auth-sql.conf.ext -> ../conf.d/auth-sql.conf.ext

    conf.d/auth-static.conf.ext -> ../conf.d/auth-static.conf.ext

    conf.d/auth-submit.conf.ext -> ../conf.d/auth-submit.conf.ext

    conf.d/auth-system.conf.ext -> ../conf.d/auth-system.conf.ext

    conf.d/auth-vpopmail.conf.ext -> ../conf.d/auth-vpopmail.conf.ext

    dovecot-db.conf.ext -> ../dovecot-db.conf.ext

    dovecot-dict-sql.conf.ext -> ../dovecot-dict-sql.conf.ext

    dovecot-ldap.conf.ext -> ../dovecot-ldap.conf.ext

    dovecot-sql.conf.ext -> ../dovecot-sql.conf.ext

    dovecot.conf -> ../dovecot.conf

    partition_map.conf -> ../partition_map.conf

     

     

    STDERR: Print: Entry, "service_initialized", Does Not Exist

    grep: /Library/Server/Mail/Config/postfix/main.cf: No such file or directory

    1+0 records in

    1+0 records out

    256 bytes transferred in 0.000039 secs (6587373 bytes/sec)

     

     

     

     

    22:21:28.075 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/80-devicemgrcommon.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:28.087 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/AccountsConfigServiceSetup.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:28.133 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/AdaptiveFirewallSetup.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:28.568 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/AddAppServerUserToAppServerGroups.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:28.656 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/CopyUninstallExtras.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:29.027 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/DisableBootP.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:29.035 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/DisableWatchDog.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:29.243 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/GenerateRNDCKey.sh

    RESULT CODE: 0

    STDOUT:

    STDERR: wrote key file "/private/etc/rndc.key"

     

     

     

     

    22:21:29.261 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/InstallServerPaths.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:29.272 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/ITDictionarySymLink.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:29.601 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/MarkServerFolderAsLocalizable.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:29.646 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/PasswordResetSetupExtras.sh

    RESULT CODE: 0

    STDOUT: Creating the password reset preferences folder

    Creating the password reset preferences folder [DONE]

    Copying default config plists

    Copying default config plists [DONE]

    Creating password reset log file

    Creating password reset log file [DONE]

     

     

    STDERR:

     

     

    22:21:32.639 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/phpsetup

    RESULT CODE: 0

    STDOUT: Running PEAR installer

    [PEAR] Archive_Tar    - installed: 1.3.7

    [PEAR] Console_Getopt - installed: 1.3.0

    [PEAR] Structures_Graph- installed: 1.0.4

    [PEAR] XML_Util       - installed: 1.2.1

    [PEAR] PEAR           - installed: 1.9.4

    Wrote PEAR system config file at: /private/etc/pear.conf

    You may want to add: /usr/lib/php to your php.ini include_path

     

     

    STDERR:

     

     

    22:21:32.917 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/ServerEventAgentSetup.sh

    RESULT CODE: 0

    STDOUT: {

        service = "com.apple.ServerEventAgent";

    }

     

     

    STDERR:

     

     

    22:21:33.169 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/SetAFPClientCount.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:33.352 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/SetAFPEncoding.rb

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:33.669 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/SetDefaultNFSThreadCount.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:33.705 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/SMARTMonitorSetup.sh

    RESULT CODE: 0

    STDOUT: {

        service = "com.apple.disks.smart.status";

    }

     

     

    STDERR:

     

     

    22:21:33.725 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/smbsetup.sh

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:33.927 Setup extra succeeded:

    path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonE xtras/webCommonSetup

    RESULT CODE: 0

    STDOUT:

    STDERR:

     

     

    22:21:33.928 Setup extra failed with code 1 at path: /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/Migrati onExtras/001-migrationExtraServerRestore.pl

    22:21:56.024 touching SetupRegComplete

    22:21:56.041 touching ServerSetupDone

    22:21:56.041 touching PromotionDone

  • by CeesBerrens,

    CeesBerrens CeesBerrens Jul 26, 2012 1:49 AM in response to ~morgen
    Level 1 (0 points)
    Jul 26, 2012 1:49 AM in response to ~morgen

    That's strange, there is no calendarmigration log (/Library/Logs/Migration/calendarmigrator.log) available on my server.

  • by ~morgen,

    ~morgen ~morgen Jul 26, 2012 6:47 AM in response to CeesBerrens
    Level 1 (140 points)
    Jul 26, 2012 6:47 AM in response to CeesBerrens

    CeesBerrens' issue is the same as noben's (unsupported language)...

     

       "option --language: invalid choice: 'nl' (choose from 'en', 'fr', 'de', 'ja')"

     

     

    davidcmn's issue is the same as sjolshag's (unexpected directory structure).  Investigating.

  • by CeesBerrens,

    CeesBerrens CeesBerrens Jul 26, 2012 7:09 AM in response to ~morgen
    Level 1 (0 points)
    Jul 26, 2012 7:09 AM in response to ~morgen

    Hi ~Morgen,

    Thanks for your reply. How can I change the language setting?

     

    Thanks in advance.

     

    Kind regards,

    Cees

Previous Page 2 of 4 last Next