Let's assume that the domain configuration is under /var/yp/<domainname>;
Let's assume the NIS server configuration is under /var/yp;
Let's assume you have some NIS related configuration files under /etc/ as well. Those could be /etc/yp.conf, /etc/ypserv.conf, /etc/ypserv.securenets and possible others (their filenames usually begin with yp....
What you need to do in order to move your NIS to the new server:
Copy all of these files from the old server to the new one.
Make sure they are not existent there beforehand or if they are - take backups before overwriting them!
Decide if the new server will have the same hostname and IP address as the original master.
If the name is the same you would skip the clients reconfiguration, otherwise it will be necessary to point to the right server (host or IP). I would rather reconfigure the clients
Copy the passwords, groups, shadow files from the old server to the new one
Once you have all files on the new server, run make -C /var/yp
You may need to stop the NIS service on the old server, as the domains are to be the same and can't have two master servers. If no errors - continue with following steps. Otherwise - well ... troubleshoot.
Run ypwhich on the new server and verify it returns its own hostname
Run ypcat passwd | grep <username>, ypcat group | grep <groupname>
Verify this works as expected;
Stop the NIS service on the old server, if not done earlier
Reconfigure all NIS clients
Change their /etc/yp.conf to point to the respective server: echo -e "ypserver new_NIS_server" >> /etc/yp.conf.
(alternatively this is where you would give the new machine the old one's IP/Hostname).