OS X Server: Migrating and copying wiki data between servers
Summary
Learn how to migrate wiki data from Mac OS X Server v10.6 to OS X Server (Mountain Lion), or copy wiki data between two servers.
Products Affected
Lion Server, OS X Server (Mountain Lion)
Migrating wiki data from Mac OS X Server v10.6 to OS X Server (Mountain Lion)
- 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 running 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 (Lion or Mountain Lion). You must select a new theme for each wiki after migrating.
Copying all wikis from one OS X server to another
- On the source OS X server, perform this command in Terminal as an administrator in order to dump the Postgres database to a file:
sudo pg_dump --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 read" /Library/Server/Wiki/FileData sudo serveradmin stop wiki sudo serveradmin start postgres sudo dropdb -U collab collab sudo createdb -U collab collab sudo -u _postgres pg_restore -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.
Moving a single wiki from one OS X server to another OS X server
This operation requires that both servers are running the same version of OS X Server, and is must be OS X Server v10.7.3 or later.
- Log in to the source server as an administrator and export the wiki with wikiadmin(8) by passing the wiki’s short name to the -g parameter. You may specify a directory to export to with the --exportPath parameter. For example, if the wiki were named "students" you could use a command like this:
sudo wikiadmin export -g students --exportPath /tmp/students-wiki
- Copy the exported wiki to a temporary location on the destination server. For example, you could copy the exported wiki to /tmp on the destination server.
- Log in to the destination server as an administrator, then run the following commands in Terminal to import the wiki:
sudo chown -R _postgres /tmp/students-wiki sudo wikiadmin import --importPath /tmp/students-wiki
You may need to adjust the path passed to the --importPath flag to match the name of your exported wiki.
Read more http://support.apple.com/kb/HT5082