Skip to content
Permalink
Browse files

Don't just rely on directory existence as an indicator that the servi…

…ce data directory is "external" -- do a name comparison because there are some cases where the new server root directory will get created prior to the migration extra running.

git-svn-id: https://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk@9403 e27351fd-9f3e-4f54-a53b-843176b1656c
  • Loading branch information...
m0rgen committed Jul 3, 2012
1 parent c329a2d commit 530e0850dc5141ce0e9f45e33e681a50b3b4334b
Showing with 3 additions and 3 deletions.
  1. +3 −3 contrib/migration/calendarmigrator.py
@@ -651,8 +651,8 @@ def relocateData(sourceRoot, targetRoot, sourceVersion, oldServerRootValue,
# Before 10.8, DocumentRoot and DataRoot were relative to ServerRoot

if oldServerRootValue:
if diskAccessor.exists(oldServerRootValue): # external volume
log("Using external calendar server root: %s" % (newServerRoot,))
if oldServerRootValue.rstrip("/") != NEW_SERVER_ROOT: # external volume
log("Using external calendar server root: %s" % (oldServerRootValue,))
# ServerRoot needs to be /Library/Server/Calendar and Contacts
# Since DocumentRoot is now relative to DataRoot, move DocumentRoot into DataRoot
newDataRoot = newDataRootValue = os.path.join(oldServerRootValue, "Data")
@@ -699,7 +699,7 @@ def relocateData(sourceRoot, targetRoot, sourceVersion, oldServerRootValue,
else: # 10.8 -> 10.8

if oldServerRootValue:
if diskAccessor.exists(oldServerRootValue): # external volume
if oldServerRootValue.rstrip("/") != NEW_SERVER_ROOT: # external volume
log("Using external calendar server root: %s" % (oldServerRootValue,))
elif diskAccessor.exists(absolutePathWithRoot(sourceRoot, oldServerRootValue)):
log("Copying calendar server root: %s" % (newServerRoot,))

0 comments on commit 530e085

Please sign in to comment.
You can’t perform that action at this time.