Operating System - HP-UX
1748268 Members
3508 Online
108760 Solutions
New Discussion юеВ

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

Hi All,

I am new to hpux.

I need to migrate (copy or move or using any other method) the user ids and their home folders from HP-UX 11i v1 to 11i v3.

Actually we are having almost 1000 user ids and their home folder in HP-UX 11i v1. now we have built new HP-UX 11i v3 server, we are going to migrate the application running in older version to newer version, so we have to migrate the user ids and their home folders also.

How to do this, please give step by step instructions.
13 REPLIES 13
TARUN SHARMA_1
Advisor
Solution

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

You can copy /etc/passwd /etc/shadow and /etc/group file to get the users on the new box but for getting the home directories you need to take backup of /home and restore it to the new box at /home. Afterwards you can run pwck to check consistency.
Sr Tech Lead
Tech Mahindra
Data Canter Tubli Bahrain
Jupinder Bedi
Respected Contributor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

Firstly let me know if it is a trusted system or not if not than follow the following steps

scp /etc/passwd server2:/etc/passwd
scp /etc/shadow server2:/etc/shadow

Than copy the all the user names in one file ( file1 )like below

user1
user2
user3
and so on

than run the following script and copy all the home directories of all the users to another server . Let say home directory in 11i is /home/username

for i in `cat file1`
do
scp -rp /home/$i server2:/home/
done

and if it is trusted system than you also need to do the /tcb/auth/files directory by using the above script and there is no need to copy the shadow file .




All things excellent are as difficult as they are rare
Pete Randall
Outstanding Contributor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

Is NFS available between the two servers?

If so, from serer2:

rcp server1:/etc/passwd /etc/passwd
cd /net/server1/home
find . -print |cpio -pdumxl /home


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

Hi:

First, I would not blindly copy the 'passwd' file (or '/etc/shadow') from one server to the other. You want to preserve at least the "system" account structure on the new server.

You don't say whether or not your 11.11 box is trusted; uses a shadow implementation; or is the simple, legacy 'passwd' structure.

Do you care about retaining user passwords?

Answers to some of the above questions will better dictate your choices and their relative ease.

Insofar as the '/home' directories, you can create a 'tar' archive of these on the old server to populate the new one.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

Shalom,

This depends on whether or not the system is trusted or not.

Not trusted:

scp /etc/passwd /etc/group newsystem:/tmp

Edit the files with vi or your editor choice. Take out the root and system users which should already be present on the new system.

cat /tmp/passwd >> /etc/passwd
cat /tmp/group >> /etc/group

If you are trusted tar up and move over the /tcb files. You should manually delete system users such as root before tar xvf the file back to /tcb

As far as the /home file systems, that also depends.

If located on NFS, no need to do anything accept configure automounter or autofs.

If local,

on old system:

cd /home

tar cvf /tmp/home.tar *

Locate it where there is space /tmp is an example.

scp the file to the new system and tar xvf

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TTr
Honored Contributor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

The 11.31 server has a lot of system accounts in its /etc/passwd file that do not necessarily exist in a 11.11 server so copying the /etc/passwd file would overwrite these accounts.
So instead of copying the old password file over, you should make a copy of it somehwere else, clean it up from the old system accounts and append it to the new password file.
Copying the home directories is straight forward. I would verify if the "-p" option of scp also preserves the user and group ownership.
Steven Schweda
Honored Contributor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

> Locate it where there is space /tmp is an example.

A Forum search for keywords like, say,
tar pipeline
should find examples showing how to obviate
the (potentially very large) "/tmp/home.tar"
file.
AVV
Super Advisor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

Hello,


It would be better that you create the groups before you do any copy as the home directory may have different permission for different groups. To apply the same setting, you should copy the files/dir with -p option.
senthil_kumar_1
Super Advisor

Re: How to migrate (copy or move) the user ids and their home folders from HP-UX 11i v1 to 11i v3

Hi James,


---You don't say whether or not your 11.11 box is trusted; uses a shadow implementation; or is the simple, legacy 'passwd' structure.----

11.11 is legacy password structure.

----Do you care about retaining user passwords?-----

I want to retain the users password.