System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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.
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 Jupinder Bedi,

If i use this below given command.

scp -rp /home/$i server2:/home/

The users' home directories are copied with owner permission of "root:sys"

Ex:

drwx------ 2 root sys 96 Jan 22 2009 yjiang


How to copy the home directories with owner permissions intact?
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 (again):

> 11.11 is legacy password structure. ... want to retain the users password.

I think the easiest approach would be to *convert* your 11.11 server to use a shadow implementation. Then copy-and-paste the relevant information from the 11.11 '/etc/shadow' to the 11.31 one along with the corresponding data for '/etc/passwd'.

You can upgrade to a shadow password at 11.11 with:

http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=ShadowPassword

Regards!

...JRF...
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

> How to copy the home directories with owner
> permissions intact?

I'd try "tar", as has already been suggested.

> A Forum search for keywords like, say,
> tar pipeline
> should find examples [...]

Still true.


> [...] please give step by step instructions.

For free, you can reasonably expect advice,
and you can also reasonably expect to do some
reading and learning. And even some
thinking. If you want someone else to do the
(your) whole job for you, then you might
reasonably expect to send money. But that's
only my own, personal attitude. You may find
others here (or elsewhere) who will gladly do
your job for you for the sheer joy of solving
the (your) problem(s). Many things are
possible.
Gordon Sjodin
Frequent Advisor

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

In the past I have built a script using modified data from the old password file as input and using the adduser command. This would at least put a few checks in place. Modifing the password file for a new user can cause problems.