Skip navigation

How To Backup and Restore OS X Server (Mountain Lion)

9557 Views 14 Replies Latest reply: Jan 18, 2014 10:08 AM by essandess RSS
essandess Level 1 Level 1 (0 points)
Currently Being Moderated
Apr 3, 2013 5:58 AM

I always use Carbon Copy Cloner and TIme Machine to create independent backups of my OS X Server. Last night, I upgraded my box to new 1 TB drives and used CCC to clone from the original smaller drives. Most steps went great (including CCC's creation of the ML Recovery partition), and the new drive boots fine.

 

But Open Directory doesn't work—Server.app says "can't locate replica". Googling around <https://discussions.apple.com/thread/4142833>, I see that I simply can't clone the OS X Server drive if it's set up as an OD Master. And I don't see a set of clear instructions for both backing up and restoring an Open Directory Master using Carbon Copy Cloner and, I assume, the serveradmin command.

 

Does anyone know the commands to fully backup and fully restore OS X Server (Mountain Lion 10.8.3) when it's set up as an OD Master? Or a robust way to automate this process with both Time Machine and Carbon Copy Cloner so that I know I'm making a good backup of my server?

Mac mini Server (Mid 2010), OS X Mountain Lion (10.8.2), Lion Server, EyeTV HD, Turbo.264 HD
  • cpragman Level 2 Level 2 (425 points)

    OD is one of those files that is constantly being written to, so backing up via "normal" methods can leave you with unpleasant results.  Mail is another one.

    You could try turning off all server services, before creating the image.

    Or you could try some of the server backup routines that have been specifically written to deal with this.

     

    http://krypted.com/mac-os-x-server/using-serverbackup-to-backup-lion-servers/

     

    http://techjournal.318.com/scripts/open-directory-auto-archiver/

     

    Personally, I use the second one.

  • DavidRIC Level 1 Level 1 (0 points)

    Hi ..this is a really really dumb question to your helpful reply.  So do I cut and paste the script (with the server admin addition) into Text Wrangler and save iot as a plain text file.  Then do I add it to Carbon Copy Cloner and then add it to a scheduled backup using the Beforte/After option in CCC?  Does it matteer what the file is named and what extenesion I give it please?  Failing that, is there any chnace you could email me a ready file which I simply need to add into CCC pleasse.  I too had trouble whne trying to restore a bacjup of our mail server using CCC, and would love this added functionality for peace of mind.  Thank yiu for yoiur help. Understand if you arew not in a place to actually send a file ...thought it was worth asking at least

     

    Cheers

    David

  • fkick1 Level 1 Level 1 (50 points)

    Hi,

     

    I created a preflight.sh file with the code above, but I keep getting the following error:

     

    You have configured CCC to abort your backup task if the preflight scripts ends with a non-zero exit status.

     

    I get this both with and without the serveradmin addition.


    Any thoughts?

  • OoO_Bailey_OoO Level 1 Level 1 (0 points)

    Hi,

     

    I just discovered your post here. Thanks for detailing your solution.

     

    I'm wondering if there have been any tweaks or updates to the above since you implemented it. Also, why are a lot of the quote/code blocks blank at the Bombich forum?

     

    Thanks!

  • WU-SLS Level 1 Level 1 (0 points)

    I too am wondering if there are any new tweaks or updates to this.

  • schlichter11 Level 1 Level 1 (0 points)
    Currently Being Moderated
    Oct 4, 2013 10:31 AM (in response to WU-SLS)

    Me too.

  • Put_mind_in_gear Level 1 Level 1 (0 points)

    Hi essandess,

     

    did you manage to get the script running under OS X 10.9 Server? We are getting this error:

     

    2013-11-15 12:20:11.227 serveradmin[3236:507] --Module servermgr_devicemgr's response has retain count of 3.

    /var/db/bsdpd_clients: No such file or directory

    + sh -c '/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dumpall -U _postgres | bzip2 -c > /private/var/backups/postgres.dumpall.bz2'

    pg_dumpall: could not connect to database "template1": could not connect to server: No such file or directory

              Is the server running locally and accepting

              connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

     

    Thanks in advance!

  • filipv-be Level 1 Level 1 (0 points)

    What todo when you restored os-x server with Timemachine?

     

    How can you fix Open Directory?

     

    Kind Regards!

Actions

More Like This

  • Retrieving data ...

Bookmarked By (3)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.