1752565 Members
5139 Online
108788 Solutions
New Discussion юеВ

Mass user migration

 
SOLVED
Go to solution
Chuck Ciesinski
Honored Contributor

Mass user migration

To all,

Is there an HP-UX equivalent to the MPE/ix BULDACCT process which allows for the mass replication of user-ids and attributes? My company is looking to migrate up to 40,000 user-ids and would like to not have to do a whole lot of data entry...

Thanks in advance,

Chuck Ciesinski
"Show me the $$$$$"
6 REPLIES 6
Alex Lavrov.
Honored Contributor

Re: Mass user migration

There are no such built-in command.
What exactly are you trying to do? I'm sure it can be done with a not very complicated script.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Rodney Hills
Honored Contributor
Solution

Re: Mass user migration

I would just do-

cd /home
tar cf /tmp/home.tar .

then copy /etc/passwd, /etc/group and /tmp/home.tar to the new computer. Then restore the home directories and that should do it.

Unless you are on a trusted systems, then you have to include the other support files.

HTH

-- Rod Hills
There be dragons...
Paul Sperry
Honored Contributor

Re: Mass user migration

I'd do this.

Copy the /etc/passwd file from the old server
to /somedir/userinfo on the new server

created a script like this.

cat /somedir/userinfo |while read line
do
USER=$(echo $line|awk '{FS=":";print $1}')
PASS=$(echo $line|awk '{FS=":";print $2}')
USERID=$(echo $line|awk '{FS=":";print $3}')
GID=$(echo $line|awk '{FS=":";print $4}')
INFO=$(echo $line|awk '{FS=":";print $5}')
HOME=$(echo $line|awk '{FS=":";print $6}')
SHELL=$(echo $line|awk '{FS=":";print $7}')
echo "Adding $USER"
useradd -u $USERID -g $GID -s $SHELL -c "$INFO" -o -m -k /etc/skel -d $HOME $USER
/usr/sam/lbin/usermod.sam -p`echo "$PASS"` $USER
done

Run the script and your done

Home dirs will be the same.
UIDs will be the same.
Shells will be the same.
Groups will be the same.
Passwords will be the same.
Even any comments will be the same.

then restore their home dirs on the new server

Have fun
Paul Sperry
Honored Contributor

Re: Mass user migration

$HOME $USER

Should be on the same line as the useradd command right after the -d
VEL_1
Valued Contributor

Re: Mass user migration


See the following HP-UX link. It provides tool & instruction also.

http://docs.hp.com/en/J2716-90046/ch04.html?btnPrev=%AB%A0prev

Baz_2
Occasional Advisor

Re: Mass user migration

You might also want to consider "cron" and "at" jobs, files outside of /home, unix email and other such things if you're doing a user migration.