Operating System - HP-UX
1831638 Members
1697 Online
110027 Solutions
New Discussion

Re: Move all user setting

 
peterchu
Super Advisor

Move all user setting

I have a new server ( host A ) and a existing server ( host B ) , I will move all data from host A to host B , could suggest what is the best method to move all the user data including /etc/passwd . /etc/shadow , /etc/group , how to make the user can use the same password after move the server ? thx

I remember that linux has a command can "save" the setting in /etc/passwd , /etc/grooup & /etc/shadow , but not sure what is the command , could someone can advise ? thx
5 REPLIES 5
Victor BERRIDGE
Honored Contributor

Re: Move all user setting

Hi,
Save new files on the new server, copy the files from the old on the new server but for /etc/passwd be sure you appended or completed the file by comparizon you the file you saved.... Are yuu on a trusted system?
for the home directories or data Ive found the fastest was export the filesystem form the new box to the old one, mount them on the old box then copy the the nfs mounted fs using cpio:
e.g for /home:
cd /home
find . |cpio -pduml //.

All the best
Victor
Bill Hassell
Honored Contributor

Re: Move all user setting

Be sure to copy only files from system directories that are compatible. For instance, /etc/lvmtab is *NOT* compatible and virtually nothing in /dev is compatible. /etc/shadow does not exist unless you installed the special shadow password product on your new server. Look for compatible files in /etc /sbin/init.d /usr/local /usr/contrib and so on. Applications in /opt may not be compatible, especially if the old server is, well, very old. The task will take some time to finish. The files will copy very fast, but choosing which files can be copied and which applications must be installed on the new server will take time.


Bill Hassell, sysadmin
Victor Fridyev
Honored Contributor

Re: Move all user setting

Hi,

Don't you want to use NIS, do you ? In this case all users' information will be stored on NIS master.
In any case, save on the new server /etc/passwd, /etc/shadow, /etc/group, /etc/profile and copy these files from the lod server to the new one.

Good luck.
Entities are not to be multiplied beyond necessity - RTFM
peterchu
Super Advisor

Re: Move all user setting

thx replies,

autcally I want to copy the user from unix to linux , I remember a command can do that , could advise ? thx
Bill Hassell
Honored Contributor

Re: Move all user setting

User data is very different from /etc/passwd or /etc/group. For normal users, everything is in /home/user-name. You then create the user on the new server with useradd or SAM. If you copy the password and other system files to the new server, *all* the existing passwords and user information will be erased and a new set of users and passwords will exist. There is nothing in HP-UX like the Linux command you mentioned. If you want just one user copied, don't copy system files, just copy the HOME directory for that user and then add the user to the new system.


Bill Hassell, sysadmin