LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   best way to move users (https://www.linuxquestions.org/questions/linux-general-1/best-way-to-move-users-550179/)

djidji 04-30-2007 01:31 PM

best way to move users
 
what is the best way to move user data and settings from one system to another? and how about backing up users? thanks in advance...

General Failure 04-30-2007 02:11 PM

To ensure you also move the user settings, you'll have to explicitly copy the hidden folders in the users home dir. How to transfer the actual data should be clear I guess.

Afterwards you'll just have to adjust ownership of the files (chown -R).

To do a backup, just copy those hidden folders somewhere safe.

djidji 04-30-2007 02:33 PM

thanks for the response. but what i was thinking was is there a way to tar all files and dirs including the hidden ones while preserving file ownership and properties? and if so can i go to a new system, re-create my user and untar my file and have everything in order? what confuses me is this:

- let's say i want to move user bob
- i create a new user bob on a new system
- i copy all bob's files to correct location on the new system

does user bob on new system have to have the same UID as the user bob on old system in order to be an owner of files copied? or is the username enough?

i hope this question makes sense...

Micro420 04-30-2007 02:49 PM

I do this now and then when migrating users to different computers. It's quite simple:

1) either copy the entire /etc/passwd, /etc/shadow, /etc/group, or just copy user 'bob' from those files and put that onto the new system. Bob won't know anything has changed.
2) copy, backup, and restore bob's home directory

done

To answer your question
Quote:

does user bob on new system have to have the same UID as the user bob on old system in order to be an owner of files copied? or is the username enough?
Bob needs to have the same UID from the old computer for him to access his home directory on the new computer, UNLESS you chown bob's home directory. Usernames are conveniences for us humans. I could create a user named bob with a UID of 1000, and then create a username John with a UID of 1000 on another computer. To the system, "bob" and "john" are the same people.

djidji 04-30-2007 04:17 PM

thanks a lot...


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