Archived - Lion Server: Migrating and copying wiki data from Mac OS X Server v10.6
Learn how to migrate wiki data from a Mac OS X Server v10.6 Snow Leopard to Lion Server v10.7, or copy wiki data between two Lion servers.
Important: For information about migrating wiki data from Mac OS X Server v10.6 Snow Leopard to OS X Server (Mountain Lion), see this article.
Migrating wiki data from Mac OS X Server v10.6 to Lion Server
- Copy /Library/Collaboration from the Mac OS X Server v10.6 to a temporary location on the Lion server. For example, you could copy the Collaboration folder to /tmp on the Lion server.
- Log in on the Lion 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 the Snow Leopard server:
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 Lion server to another Lion server
- 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 rake -f /usr/share/collabd/server/Rakefile db:drop sudo createuser -U _postgres -d -s 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 Lion server to another Lion server
This operation requires that both servers be running the same version of Lion Server, and that they both be running Lion Server v10.7.3 or higher.
- 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.