Migrating to new user account: must chown old account's files… I think

Is there a way to selectively chown the files/folders owned by a particular user, while leaving other files/folders untouched? I'm in the process of migrating to a fresh user account on my machine. I copied what I need from the old user's home directory and chowned it recursively, as described on an Apple support page. The support page makes no mention of chowning files/folders elsewhere on the machine, but I've found plenty of stuff in other locations that are owned by the old user:

  • /Applications (lots of stuff)
  • /Library (lots of stuff)
  • /private/var/tmp (a small lot)
  • /private/var/vm/app_profile/ (2 files)
  • /usr/local/clamXav/ (1 easily replaceable file)
  • /usr/local/lib/codec/ (4 files/folders)

I'm planning to delete the old user once I'm confident that everything is working, and I'm not sure what would happen if some critical files are owned by a deleted user. The old user was an admin account, if that matters. Oh, and I'm running OSX 10.4.11 on a PPC mac, if that matters.

Any help appreciated 🙂

PowerBook, Mac OS X (10.4.11)

Posted on Oct 4, 2012 7:39 AM

Reply
2 replies

Oct 4, 2012 8:45 AM in response to roboboticus

Nothing owned by an account you've created is necessary to Mac OS X, and none of the items in those locations will automatically be transferred to the new account; some of those may contain the old account's UID in their filename, which means that they can't be transferred to the new one by chown.


You may want to try these instructions. If you do, read all the comments before proceeding.


(70426)

Oct 6, 2012 12:20 PM in response to Niel

Niel- that article you linked to is great. Lots of helpful info that's relevant to my situation. Thanks!


After reading the article and comments, I'm a little unsure whether to use "find -L" or just "find" (or "find -P") when finding files that need chowning. It sounds like "find -L" would include symlinks that point to files/folders owned by the old user, regardless of who owns the symlink itself, whereas "find -P" would only include symlinks that are themselves owned by the old user. I think "-P" is what I need (the man page says the -P behavior is the default, so I guess I just need "find" by itself). Someone commented about this, and the article's author acknowledged some of their other suggestions, but not this one. ?


I think if I was going to change ownership of all the old user's files, I'd need to run the following commands on a few directories (/Applications, /Library, etc.):

find $dir -user $olduser -exec chown -h $newuser {} \;

find $dir -group $olduser -exec chgrp -h $newuser {} \;


I'd also have to look for filenames that end in the old user's uid, with something like

find / -name "*501"

or

find -L / -name "*501"


However, it occured to me that while there may be files I want that are owned by the old user, there are probably also files I don't want to migrate over, like if the system's already created equivalent files for the new user and I'd be overwriting something that could cause problems. I'm going in circles 😝


At this point I think I'd better make such changes selectively when problems crop up that I think could be solved by doing so, rather than make system-wide changes in one fell swoop. I want to fix small problems, not make big ones.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Migrating to new user account: must chown old account's files… I think

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.