LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   transfering a whole dataserver (https://www.linuxquestions.org/questions/linux-newbie-8/transfering-a-whole-dataserver-411167/)

xpucto 02-03-2006 03:30 AM

transfering a whole dataserver
 
Hi!

I bought a new server and would like to transfer all data (around 30GB) from the old to the new server. I guess that is a pretty classical job and I'm not quite sure how to do it. How is it the typical way to handle such a case: transfer files with permissions and ownerships, and transfering the users from the old to the new server.
Should I use scp, mount, ssh & tar?

I started with scp but I lose then the ownerships. But If I want to keep the ownerships, then all the users have to be registered in the new server, but then if i just past users an groups from the old to the new, I'm afraid that some group_Id or anything might not be working beacause there are already users in the new server.

I hope that I'm not being too confusing and would appreciate to learn what is the clean way to handle this case.

Thanks.

Nathanael 02-03-2006 04:08 AM

rsync (over ssh) unison (over ssh) or tar archives do the job. unison is actually a file syncronizer, but can be handy for such a single use. you might have to edit /etc/passwd and /etc/group and /etc/shadow manually, so you dont overwrite any system user data. use the programs vipw (for /etc/passwd) and vigp (for /etc/group). a simple copy and past of the user data is ok here. read the man pages for rsync, unison or tar, depending on what you want to use, so you can see which parameters you need for keeping ownership and permissions (you might want to use numerical ownership if you transfere the data before creating the users)

xpucto 02-03-2006 05:18 AM

Thanks!
Quote:

Originally Posted by Nathanael
use the programs vipw (for /etc/passwd) and vigp (for /etc/group). a simple copy and past of the user data is ok here. read the man pages for rsync, unison or tar, depending on what you want to use, so you can see which parameters you need for keeping ownership and permissions

Will then shadow be automatically updated?
Quote:

Originally Posted by Nathanael
(you might want to use numerical ownership if you transfere the data before creating the users)

How may do this?

Nathanael 02-05-2006 04:06 PM

1. no, shadow is not automatically updated, you have to do this using vim again. i have not seen a tool like vipw or vigp to edit the shadow file. but a simple copy and paste should do the trick. please dont forget to only transfere the entries corresponding to actual users and not system users (you can destinguish between users and sys-users by the login program specified, eg. /bin/bash or /bin/false, sys-users will have something that is not a shell:/bin/false)

2. have a look at the man page for whatever program you choose to use. tar for example will use the parameters --preserve and --numeric-owner. you should generally read the man page if you are not familiar with a programm.

xpucto 02-07-2006 09:23 AM

In the first server I have in group:
sysadmin::14:bob,Dave
and in the 2nd I only have
" sysadmin:: "
without any user. May I just add manually bob and Dave in the file "group" of the second server?

Nathanael 02-08-2006 09:25 AM

yes you may


All times are GMT -5. The time now is 07:54 PM.