OS X Server: Migrating and copying wiki data from Mac OS X Server v10.6
Learn how to migrate wiki data from Mac OS X Server v10.6 Snow Leopard to OS X Server (Mountain Lion), or copy wiki data between two OS X Server (Mountain Lion) servers.
Mac OS X Server 10.6, OS X Server (Mountain Lion)
Important: For information about migrating wiki data from Mac OS X Server v10.6 Snow Leopard to Lion Server, or for information about migrating wiki data between two Lion Servers see this article.
Migrating wiki data from Mac OS X Server v10.6 to OS X Server (Mountain Lion)
- Install or update to the latest version of OS X Server (Mountain Lion) via the Mac App Store.
- Copy /Library/Collaboration from Mac OS X Server v10.6 to a temporary location on OS X server. For example, you could copy the Collaboration folder to /tmp on OS X server.
- Log in to OS X Server as an administrator and ensure that the permissions are correct by executing this command in Terminal:
sudo chown -R _teamsserver:_teamsserver /tmp/Collaboration
Now you can use the wikiadmin(8) command to migrate all of the wikis copied from Mac OS X Server v10.6:
sudo wikiadmin migrate -r /tmp/Collaboration
Alternatively, you can choose to migrate a single wiki. In the following example, the wiki being migrated is called "students":
sudo wikiadmin migrate -r /tmp/Collaboration -g students
Note: If Mac OS X Server v10.6 was configured to host wiki data somewhere outside of the default location (/Library/Collaboration), the wiki data won't be migrated when upgrading to OS X Server. To import Mac OS X Server v10.6 wiki data after the upgrade to OS X Server, use "wikiadmin migrate" as above, but specify the Mac OS X Server v10.6's wiki data location instead of /tmp/Collaboration:
sudo wikiadmin migrate -r /Volumes/RAID/Collaboration
Note: Mac OS X Server v10.6 wiki themes are not preserved during migration to OS X Server (Mountain Lion). You must select a new theme for each wiki after migrating.
Copying all wikis from one OS X server to another OS X server
- Update to OS X Server v2.2 or later on both the source and destination servers.
- On the source server, execute these commands in Terminal as an administrator, in order to dump the Postgres database to a file:
cd /Applications/Server.app/Contents/ServerRoot/usr/bin/ sudo ./pg_dump -h "/Library/Server/PostgreSQL For Server Services/Socket" --format=c --compress=9 --blobs --username=collab --file=/tmp/collab.pgdump collab
- Copy /tmp/collab.pgdump from the source server to /tmp/collab.pgdump on the destination server, then copy the contents of /Library/Server/Wiki/FileData on the source server to /Library/Server/Wiki/FileData on the destination server.
- Log in to the destination server as an administrator and execute the following commands in Terminal to ensure correct ownership and permissions, start the Postgres database, populate it with the data dumped from the source server, and finally start up the wiki service:
sudo chown -R _teamsserver:_teamsserver /Library/Server/Wiki/FileData sudo chmod -R +a "www allow search" /Library/Server/Wiki/FileData sudo serveradmin stop wiki sudo serveradmin start postgres_server cd /Applications/Server.app/Contents/ServerRoot/usr/bin/ sudo ./dropdb -h "/Library/Server/PostgreSQL For Server Services/Socket" -U collab collab sudo ./createdb -h "/Library/Server/PostgreSQL For Server Services/Socket" -U collab collab sudo -u _postgres ./pg_restore -h "/Library/Server/PostgreSQL For Server Services/Socket" -d collab -U collab --single-transaction /tmp/collab.pgdump sudo serveradmin start wiki
Important: These steps will cause any wikis already present on the destination server to be lost.
Note: Migrating wikis does not migrate users or groups. These instructions are intended for use when the new server is bound to the same directory server as the previous server.