Mac – Restoring OS X Server Data from Time Machine

osx-serverrestoretime-machine

How does one restore OS X Server data from time machine on another server?

I had a Mac mini with OS X Server (Mountain Lion). It had Time Machine backups and this weekend the server experienced a hardware problem. I'm trying to migrate the server to another server. When trying to restore it on another machine, I get the following error.

enter image description here

I then installed OS X Mountain Lion 10.8 and OS X Server and then tried to restore the /Library/Server folder to the new machine. Unfortunately, this failed because some folders are locked.

Best Answer

The KB article HT5139 "Restoring OS X Server from a Time Machine backup" describes how to restore OS X Server (Mountain Lion) or Lion Server from a local Time Machine backup:

The steps to restore from a Time Machine backup depend on whether your data was stored on the startup (boot) volume or a non-startup volume.

Important: When restoring, restore from a local Time Machine backup. If you try to restore from a network-based Time Machine backup, not all settings will be restored correctly.

(...)

Time Machine is the native backup service for OS X Server. OS X Server also includes a process called ServerBackup which works with Time Machine. ServerBackup performs daily backups of Open Directory (if it is enabled) and the Postgres databases used by the Calendar (or iCal), Contacts (or Address Book), Profile Manager, and Wiki services. These daily backups are included in the Time Machine backup of Lion Server. ServerBackup also takes part in the restoration of server services, running during the first startup after a server has been restored, and restoring server services and databases into place after the server has started up.

From KB article HT5139:

If server data was on the startup disk proceed as follows:

  1. Make sure your local Time Machine backup drive is connected.
  2. Start up your server using OS X Recovery by holding down CommandR.
  3. Select Restore from Time Machine Backup and follow the onscreen instructions for restoring the volume.

Otherwise:

  1. Make sure your local Time Machine backup drive is connected.
  2. Start up your server using OS X Recovery by holding down CommandR.
  3. If your Time Machine drive is encrypted:

    • Open Disk Utility, then click Continue.
    • Control-click or right-click the Time Machine volume, then select "Decrypt".
    • Enter the volume password and click OK.
    • Create or make sure that you have a new service data volume that is large enough to store your previous data and has the same name as your previous service data volume.

      For example, if your service data was stored on a 500 GB volume named "DataHD", make sure you have a new volume of at least 500 GB named "DataHD".

    • Quit Disk Utility.
  4. From the Utilities menu, choose Terminal.
  5. Enter the following command on one line.

    Replace Time Machine Backup Disk with the name of your Time Machine backup disk, servername with the name of your server, and Startup Volume Name with the name of your previous startup volume.

    cd /Volumes/Time Machine Backup Disk/Backups.backupdb/servername/Latest/Startup Volume Name/

  6. Enter the following command on one line. Replace Service Data Volume with the name of your original (and future) service data volume.

    ./usr/bin/tmutil restore -v ../Service Data Volume/* /Volumes/Service Data Volume

  7. Quit Terminal.

  8. If you also need to restore the startup volume, select "Restore from Time Machine Backup" and follow the onscreen instructions.

I realize that you tried the first option and it failed with a model mismatch error. You may want to try the second option.