Restoring Mac OS X Server from Time Machine
If you’re running Mac OS X Server 10.5.x or higher, you may be backing it up with Time Machine. However, Time Machine has gotten a bad reputation with some admins because of what Time Machine *doesn’t* back up. That being said, since Time Machine saved my bacon this past weekend, I wanted to post a Time Machine restoration how-to that (depending on your configuration) can be a lifesaver for your Mac or XServe running Mac OS X Server.
To recover the system:
1. Connect the Time Machine backup disk to the server (should already be connected, but double-check.)
If you’re restoring your system because of a problem with the startup disk, make sure the disk has been repaired or replaced.
2. Insert your Mac OS X Server Install disk, and boot from the installer disk.
3. In the Installer, choose Utilities > Restore System from Backup.
4. In the Restore Your System dialog, click Continue.
5. Select your Time Machine backup volume.
6. Select the Time Machine backup you want to restore.
7. Follow the onscreen instructions.
YouTube video showing the recovery process: http://www.youtube.com/watch?v=ZmvwcRJ6sww
Following a Time Machine restore:
Recreate folders that are not included in the Time Machine backup as described below.
Open Terminal (in /Applications/Utilities).
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
sudo mkdir /var/log/samba
sudo mkdir /var/log/swupd
sudo touch /var/log/daily.out
sudo touch /var/log/weekly.out
sudo touch /var/log/monthly.out
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
To restore the Mail service, execute the following command:
sudo /etc/postfix/post-install create-missing
After running these commands, restart the server.
Exceptions to the rule:
Databases – Time Machine is a file-based backup, and doesn’t handle backing up active databases that well. However, it does a good job of backing up database backup files. If you’re running a database on your server (and you are if the server is an Open Directory Master, as OD works from an LDAP database), make sure to set up an automated process that automatically backs up your database to the appropriate backup file (varies by database) on a regular basis.
Mail – On 10.5 Server (I don’t know about 10.6.x Server), Time Machine does not back up the /private/var/spool directory. As a result, nothing in /private/var/spool or the directories inside spool are backed up. This is important for those running a mail server because /private/var/spool/imap which is where IMAP users’ E-mail is stored.
If you’re using Time Machine to back up a 10.5.x server where you’re also running mail services, I recommend that you go to /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist and comment out the /private/var/spool exclusion using the following:
<!– /private/var/spool –>