Restoring Wiki From Time Machine Backup

05May10

wiki.pngI have been tinkering with a new Mac Mini Server recently installed at our studio. While I consider myself tech savvy, I don’t pretend to be an expert on such subjects as DNS configurations, advanced firewalls, VPN and NAT. So while trying to setup the server as a gateway between the web and our office, it was not entirely unexpected that I would leave myself stranded at the bottom of a very deep hole, dug using my own ignorance. There was no way out so I had little alternative but to roll back to the last Time Machine backup taken before my ill advised networking adventure. 

Apple proudly sings the virtues of using Time Machine as a backup solution for Mac OS X Server 10.6. However, while I had no problem restoring the system, I was left with some unexpected issues once the server was rebooted. Most services worked as advertised but upon launching the company wiki and blogs within Safari, I was presented with a ‘503 error’ page. 

After nearly 4 hours of scouring support forums, knowledge bases and mailing lists I finally got the bottom of the issue. Time Machine automatically skips over caches and log files when creating a backup. Usually this is no problem but it seems that the ‘teams’ service that powers the wiki and blogs feature in Mac OS X Server requires the presence of its log file to operate correctly. This discovery finally led me to a knowledge base article on Apple.com that gives step by step instructions on recreating the necessary files and restoring the correct permissions to the wiki directory. 

By following the instructions below I was able to restore wiki functionality…

To restore the Web service (server):

  1. Open Terminal (in /Applications/Utilities).
  2. Execute these commands, each on its own line, followed by Return. Note: When using these commands you will be prompted for an administrator’s password.

    sudo mkdir /var/log
    sudo mkdir /var/log/apache2

  3. To restore the Wiki service (server), run the following commands in addition to those above:

    sudo mkdir /Library/Logs/wikid

    sudo chown _teamsserver:_teamsserver /Library/Logs/wikid

After running these commands restart your server.

Advertisements


4 Responses to “Restoring Wiki From Time Machine Backup”

  1. 1 Luke Garfoot

    This is very helpful stuff… I knew there would be issues with rebuilding my server and trying to get the wiki back up and running on it, and thank god i found this before doing it.

    Thanks 🙂

  2. 2 Phil

    Perfect, worked like a charm. Thank you for sharing this info.

  3. For OSX 10.8 Mountain Lion it works like this:

    get the Backup file in /Library/Server/PostgreSQL For Server Services/Backup/dumpall.psql.gz

    extract the file to /tmp/dumpall.psql or to an other directory

    Follow the instructions in http://support.apple.com/kb/HT5585 like this:

    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

    Then use “psql” instead of “pg_restore”:
    sudo psql -U _postgres -d collab -h “/Library/Server/PostgreSQL For Server Services/socket” -f /tmp/dumpall.psql
    Start the Wiki Server
    sudo serveradmin start wiki

    Done!

    Greets

    Bolla

  4. You post interesting posts here. Your page deserves much
    more visitors. It can go viral if you give it initial boost, i know
    useful tool that can help you, just search in google: svetsern traffic tips


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: