I just got a new dedicated server and in the process of transferring files from my older shared server. I used TAR and FTP to copy the files. Here's the problem, the permission and owner settings don't get copied over. That means I'll have to manually set the permissions. Worst of all, there are a lot of data files created by CGI scripts, for those, how do I reset the owner settings? Im hoping there is a better way. Please help. Thanks!
drewnick
02-17-2002, 06:44 PM
Did you use the "c" flag when you tarred the files? I think this is better left to another forum... but hopefully we can help you here rather quickly.
Drew
Sorry for going off subject.
Yes, I did use the -c flag... tar -cvf temp.tar xxxx/
Are you saying tar with the -c flag SHOULD do what I wanted it to do? If that's the case, maybe I've messed up. Guess I should try again.
drewnick
02-17-2002, 06:51 PM
Doh! -p flag rather for "permissions"
Drew
Great! Will that take care of the owner setting too?
I have a couple of UNIX books but none of the go beyond -c -v -f. Guess I need some new books :)
drewnick
02-17-2002, 06:56 PM
The p will keep the UID and GID as well as permissions. So you need to set the users up with the same UID/GID as they had on the source server.
Drew Nichols
Since I don't have a reference book on the -p flag so I don't know exactly how to apply it... I tried the following:
tar -pcvf temp.tar xxx/
tar -xvf temp.tar
RESULT: Permissions are fine but owner settings look strange... instead of admin, the new owner is 1057. Instead of www, the new owner is zope.
What am I doing wrong?
priyadi
02-17-2002, 08:06 PM
Tar stores username and group as its number, not its name. So I think your new system has different username to UID mapping (i.e. has different /etc/passwd). From a quick glance on tar man page, I can't see any option to store username, not UID on tar files. :(
drewnick
02-17-2002, 09:29 PM
Bee,
As I said in my last post, it will save the UID/GID
You'd need to have these synchronized between the two machines.
Drew
panopticon
02-18-2002, 03:40 AM
I don't have a dedicated server yet, but I'm thinking of getting one soon and I didn't think of this issue, so I was following this thread with some interest (since I have a low speed connection myself and will thus transfer the files via tar -czpf / server to server from the old accounts.)
If you were moving files from several different virtual servers, how would you 'syncronize' the "UID/GID" mapping?
Couldn't you simply change the ownership recursively of all the files to the new usernames? Or is it more complicated than this?
priyadi
02-18-2002, 07:25 AM
Originally posted by panopticon
If you were moving files from several different virtual servers, how would you 'syncronize' the "UID/GID" mapping?
Copy the files that store it, in Linux it is /etc/passwd, /etc/shadow and /etc/group.