This tip sheet assumes that you already have a NIS+ setup configured and
presently want to make another machine ( probably new) the root master for
various reasons.
The sequence of the steps would be :
1) Dump the tables from the old master
2) making the new machine the root master for the domain
3) gradually moving the existing clients towards the new root master
( including the existing replicas),
4) recreating required replicas,
5) De-comission the old master(which can later be made a client/replica to
the new master if needed)
SETTING UP THE NEW MACHINE AS THE ROOT-MASTER:
----------------------------------------------
1) Dump the nis+ datbase from the old master
old-master# mkdir /var/nisfiles
old-master# cd /var/nisfiles
old-master# /usr/lib/nis/nisping -C groups_dir.`domainname`.
old-master# /usr/lib/nis/nisping -C org_dir.`domainname`.
old-master# /usr/lib/nis/nisping -C `domainname`.
old-master# /usr/lib/nis/nisaddent -d aliases > aliases
old-master# /usr/lib/nis/nisaddent -d bootparams > bootparams
old-master# /usr/lib/nis/nisaddent -d ethers > ethers
old-master# /usr/lib/nis/nisaddent -d group > group
old-master# /usr/lib/nis/nisaddent -d hosts > hosts
old-master# /usr/lib/nis/nisaddent -d netgroup > netgroup
old-master# /usr/lib/nis/nisaddent -d netid > netid
old-master# /usr/lib/nis/nisaddent -d netmasks > netmasks
old-master# /usr/lib/nis/nisaddent -d networks > networks
old-master# /usr/lib/nis/nisaddent -d passwd > passwd
old-master# /usr/lib/nis/nisaddent -d protocols > protocols
old-master# /usr/lib/nis/nisaddent -d publickey > publickey
old-master# /usr/lib/nis/nisaddent -d rpc > rpc
old-master# /usr/lib/nis/nisaddent -d services > services
old-master# /usr/lib/nis/nisaddent -d shadow > shadow
old-master# /usr/lib/nis/nisaddent -d timezone > timezone
old-master# /usr/lib/nis/nisaddent -d -t auto_home.org_dir key-value > auto_home
old-master# /usr/lib/nis/nisaddent -d -t auto_master.org_dir key-value > auto_master
2) Make a "/var/nisfiles" directory on the new master and copy all the files
under /var/nisfiles on the old master to /var/nisfiles on the new master.
new-master#rcp oldmaster:/var/nisfiles/* /var/nisfiles
(rcp requires the presents of a .rhosts file or a host.equiv file on the
remote machine so the user is not prompted for a password.)
***NOTE: If the same IP and the name are being used for the old-master and
the new-master machine, the files need to be copied to a third machine,
the old-master must be removed from the network, and the new master
configured properly, so that it assumes the same name and IP address of the
old-master
3) Build the new master
***NOTE: If the new-master is already an NIS+ machine (replica/client)
belonging to the old domain, NIS+ has to be removed from the machine
new-master# cp /etc/nsswitch.files /etc/nsswitch.conf
new-master# kill <PID_of_rpc.nisd>
new-master# kill <PID_of_rpc.nispasswdd>
new-master# kill <PID_of_nis_cachemgr>
new-master# rm -f /etc/.rootkey
new-master# rm -rf /var/nis/*
new-master# rm -rf /etc/defaultdomain
*** REBOOT at this point).
]
new-master# /usr/lib/nis/nisserver -v -r -d <domainame.with.railing.dot>
4) Remove the lines related to the new-master from /var/nisfiles/publickey
eg: unix.new-master@domain
5) Add the new-master's present publickey to the /var/nisfiles/publickey
new-master# /usr/lib/nis/nisaddent -d publickey >> /var/nisfiles/publickey
6) Populate the tables on the new master.
new-master# cd /var/nisfiles
new-master# nispopulate -v -F
7) Update the database with the original publikeys.
new-master# nisaddent -rv -f /var/nisfiles/publickey publickey
8) Checkpoint the database
new-master# /usr/lib/nis/nisping -C org_dir
new-master# /usr/lib/nis/nisping -C groups_dir
new-master# /usr/lib/nis/nisping -C
MOVING THE CLIENTS TO THE NEW MASTER:
-------------------------------------
9) Copy the /var/nis/NIS_COLD_START from the master on to the client's
/var/tmp and reinitialise the client.
client# rcp new-master:/var/nis/NIS_COLD_START /var/tmp
client# nisinit -c -C /var/tmp/NIS_COLD_START
client# kill <PID_of_nis_cachemgr>
client# rm /var/nis/.NIS_PRIVATE_DIRCACHE /var/nis/NIS_SHARED_DIRCACHE
client# /usr/sbin/nis_cachemgr
REINITIALISE THE REPLICAS:
---------------------------
10) Remove nis+ from the old replicas (PSD section 3.17) and reinitilise as
clients( PSD section 3.2 (and then as replicas for the new master if needed).
(PSD section 3.3)
REMOVE THE NIS+ FROM THE OLD MASTER AND REINITILISE AS CLIENT:
--------------------------------------------------------------
11) Remove the nis+ from the old master and initilise as a client to the new
master (PSD section 3.17 and PSD section 3.2).