LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to migrate users from old server to new server (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-migrate-users-from-old-server-to-new-server-4175426070/)

Naveen Kumar Joshi 09-07-2012 01:16 AM

How to migrate users from old server to new server
 
Hello, I want to know that how we can migrate user from old server to new server. But my question is about how we can implement user on new server where user id is same as in old server. i.e. user called joshi whozz UID is 500 in old server and user call Naveen whozz UID is 500 same as joshi in new server. please help me in clear this difficulty

Toggan 09-07-2012 01:20 AM

You can specify the UID when adding the user using useradd, it's the -u flag.

So in this case, you'll have

useradd joshi -u 500

Check out the man pages for useradd for more information. (man useradd or useradd --help)

Naveen Kumar Joshi 09-07-2012 01:45 AM

Migration of users in old to new server but in new server same UID users are present
 
Actually, i m migrating the users from old server to new server, but there is already a users whos id is 500, 501, 503 in new server.. and these UIDs are alerady present in old server too.. i cant over write it how can i change UID of the old server users id While migrating the all users in the new server, in one command

descendant_command 09-07-2012 02:01 AM

Quote:

Originally Posted by Naveen Kumar Joshi (Post 4774764)
how can i change UID of the old server users id While migrating the all users in the new server, in one command

Hire someone and issue the command "Do it!" :)

chrism01 09-07-2012 03:16 AM

If you're migrating the users and their files, you'll need to write a short bash script and run it as root.
It just needs to calc new uid, create user (inc home dir) & copy the files over and change the ownerships to match.
Don't forget the gids as well.


All times are GMT -5. The time now is 05:58 PM.