TITLE
    Mac OS X Server: Restoring NetInfo Configuration
Article ID:
Created:
Modified:
30765
9/24/98
10/31/00

TOPIC

    How do I restore a NetInfo configuration?


DISCUSSION

    In certain circumstances you may want to restore your NetInfo database from a backup copy or from the default templates that are installed with the server software. For instance, you might want to replace a corrupted NetInfo database or undo unwanted changes.

    Warning: Creating a new NetInfo database from the default templates will erase all changes that you have made to NetInfo since installation. If you have invested a lot of time configuring a NetInfo database, you probably want to rebuild it from scratch only as a last resort. If possible, it is generally easier to restore the /etc/hostconfig file and the contents of /etc/netinfo from backups made when the network was functioning properly.

    In either case, you should start up the server computer into single-user mode before replacing the NetInfo database. For information on how to start up into single-user mode see:
    Article 30837: " Mac OS Server: Starting Up Into Single-User Mode. "

    When Mac OS X Server is starts up into Single-User Mode, the file system is mounted as read only. To carry out either of the procedures outlined below, you must mount it as read-write.

    First, for safety, run fsck:

    #fsck -f -y

    fsck will then run. At the next command prompt (#), mount the file system:

    #/sbin/mount -uw /


    Restoring from backup

    A backup of your NetInfo database is made every night (assuming your server computer is on overnight) into the /var/backups directory. In the event that you just did something catastrophic to your NetInfo configuration, you can restore yesterday's version.

    1. Start up the server computer into single-user mode
    2. At the # prompt, enter the following commands to rename the current NetInfo database and replace it with the archived copy:
      mv /etc/netinfo /etc/netinfo.old
      cd /var/backups
      pax -rw netinfo /etc
    3. Restart the server computer.


    Restoring from defaults

    You need to do three things: obtain a default NetInfo database, an original hostconfig file, and an original hosts file.

    1. Start up the server computer into single-user mode
    2. At the # prompt, enter the following commands to rename the current files:
      cd /etc
      mv netinfo netinfo.old
      mv hostconfig hostconfig.old
      mv hosts hosts.old
    3. Enter the following commands to copy the default files back to the /etc directory:
      cp -rp /usr/template/client/etc/netinfo /etc
      cp -p /usr/template/client/etc/hostconfig /etc
      cp -p /usr/template/client/etc/hosts /etc
      reboot
    This sets your server computer back to a default NetInfo configuration, as it was when you first installed Mac OS X Server. When the computer is finished starting up the Setup Assistant will run.

Document Information
Product Area: Mac OS System Software
Category: Mac OS X Server
Sub Category: Troubleshooting
Keywords: kmosXserver, supt

Copyright © 2000 Apple Computer, Inc. All rights reserved.