LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-07-2012, 01:16 AM   #1
Naveen Kumar Joshi
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Rep: Reputation: Disabled
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
 
Old 09-07-2012, 01:20 AM   #2
Toggan
Member
 
Registered: Oct 2011
Distribution: CentOS 5.9
Posts: 39

Rep: Reputation: 6
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)
 
Old 09-07-2012, 01:45 AM   #3
Naveen Kumar Joshi
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
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
 
Old 09-07-2012, 02:01 AM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,426

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by Naveen Kumar Joshi View Post
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!"
 
Old 09-07-2012, 03:16 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,294

Rep: Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358
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.

Last edited by chrism01; 09-07-2012 at 03:18 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to import windows users / passwords into openldap server - ldap migrate migration dananarama Linux - Software 1 11-23-2009 07:37 AM
Migrate DNS Records from Old Server to New Server OThankHeaven Linux - Server 2 11-03-2009 01:23 PM
How to automatically migrate users from server to client? rsamurti Zenwalk 2 12-09-2008 09:35 AM
How do i migrate SAMBA server to diffrent server. Koushik Biswas Linux - Server 1 11-13-2008 08:51 AM
Best way to migrate Linux server to another server tensigh Linux - Server 5 06-17-2007 11:43 PM


All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration