Jump to content


Photo

Copy/ Migrate User Account on same mac


  • Please log in to reply
9 replies to this topic

#1 boloman

boloman

    New Mac Geek

  • Members
  • 3 posts
  • Gender:Male
  • Location:Quebec, Canada

Posted 08 April 2008 - 02:12 PM

Howdy,

Does anyone know how to selectively copy or migrate one user account to another user on the same mac?
Thanks,

#2 Dolphbucs

Dolphbucs

    Alpha Mac Geek

  • Members
  • 882 posts
  • Gender:Male
  • Location:Rochester, NY USA

Posted 08 April 2008 - 02:35 PM

As far as I know, there is no "template" or "copy user function" in system preferences. The only way I can figure to do this would be to copy the entire contents of the home folder to an external drive or another partition and then copy it back into the other user acct ( you could also use the "Shared" folder in /users, but be careful to copy the files there, not move them ). You might run into some permissions issues doing this though ( the new user folder might not have access to all the files depending on the permissions of each file or folder.

But what exactly is it that you are trying to accomplish? I would think that the main reason this option is not offered is to protect one user acct from the others in the event of a corruption, or worse, malware infection. Post specifically what it is you are trying to migrate and I'll try to help you find the proper files to migrate.

#3 Huskermn

Huskermn

    Mac Geek God

  • Administrators
  • 2,102 posts
  • Gender:Male
  • Location:Twin Cities, Mn
  • Interests:Macs, Harleys (actually, motorcycling in general) and Huskers.

Posted 08 April 2008 - 07:45 PM

I'm not at my Mac so can't check, but you might be able to do that with the Migration Assistant.

#4 boloman

boloman

    New Mac Geek

  • Members
  • 3 posts
  • Gender:Male
  • Location:Quebec, Canada

Posted 08 April 2008 - 08:54 PM

I'm trying to migrate from a corrupted user account to a good one on the same box.
That's why I am looking for SELECTIVE migration or copy function.

Migration Assistant doesn't seem to offer this capacity. My only other guess would be a Time Machine backup and Restore.

#5 Huskermn

Huskermn

    Mac Geek God

  • Administrators
  • 2,102 posts
  • Gender:Male
  • Location:Twin Cities, Mn
  • Interests:Macs, Harleys (actually, motorcycling in general) and Huskers.

Posted 09 April 2008 - 01:03 AM

Do you know what's corrupted?

You can just copy the contents of User folders (though, it's not always straightforward).

#6 Dolphbucs

Dolphbucs

    Alpha Mac Geek

  • Members
  • 882 posts
  • Gender:Male
  • Location:Rochester, NY USA

Posted 09 April 2008 - 11:20 PM

If it's a corrupted acct, you won't want to copy over any plist or Library files anyway. The data files you can simply and safely transfer over by copying them to the "shared" folder inside the users folder of your main HD. Then simply re-copy them from the shared folder into the new user acct ( like I said above ). By data files I mean your Documents folder, and any data files stored inside application support. You could do the same with your iTunes and Pictures folders if you know they are not corrupted. You also could try the Time Machine route .... I believe migration assistant will alloe you to restore from a TM volume .... just be careful you aren't copying anything that may be corrupted.

Also, do you have any idea what type of corruption you have? What's going wrong with your old user acct?

Edited by Dolphbucs, 09 April 2008 - 11:25 PM.


#7 boloman

boloman

    New Mac Geek

  • Members
  • 3 posts
  • Gender:Male
  • Location:Quebec, Canada

Posted 10 April 2008 - 12:26 PM

The problems manifest in many small ways, applications (icons) will not stay in the dock, setting not retained, etc, just weird stuff like this, mostly Finder based.
The new account exhibits NONE of the same issues.

#8 Dolphbucs

Dolphbucs

    Alpha Mac Geek

  • Members
  • 882 posts
  • Gender:Male
  • Location:Rochester, NY USA

Posted 10 April 2008 - 12:53 PM

OK, then I would say you definitely should just transfer the data files as I outlined above. If you want to move over any plist files for third party apps, I would do so one at a time to see if they behave themselves. But I would stay away from transferring anything other than that.

#9 ganbustein

ganbustein

    Super Mac Geek

  • Members
  • 100 posts
  • Location:Berkeley CA

Posted 12 April 2008 - 01:57 AM

The problems manifest in many small ways, applications (icons) will not stay in the dock, setting not retained, etc, just weird stuff like this, mostly Finder based.
The new account exhibits NONE of the same issues.

It might be simpler to just trash your Preferences folder. You're effectively doing that anyway, by copying over everything but.

It's sometimes ineffective to trash a preference file for an application that's in use. An application typically just sucks in its preferences when it starts up and holds them in RAM. If any preference changes, it makes the change in RAM, and then completely rewriting the preference file. If you've deleted the file in the meantime, the application won't even notice. Similarly, if you've modified the preference file (using 'defaults write ...' in Terminal, for example), your change gets lost when the application updates the file with its saved values that don't reflect your change.

Which means especially that it's hard to trash preferences for applications that are running all the time, like Finder and Dock. The right way to do this is to trash your preferences while the GUI is not running.

Which means you have to do it in a non-GUI way. Log in as a different user. DO NOT use fast user switching here; the point is that the user whose account you're trying to clean up must not be logged in. That is, if user 'boris' needs to be cleaned up, log out of 'boris' and log in as some other user, say 'rocky'.

Then have 'rocky' open Terminal. Enter the command 'su -l boris', and supply boris' password when asked. You are now logged in as 'boris' but in a non-GUI way. You can therefore delete individual preferences or the entire Preferences folder using terminal commands, with no concern that GUI applications might be trying to use the same files.

# log in as boris
su -l boris
Password _linenums:0'># log in as borissu -l borisPassword: <boris' password># example of how to delete individual preference file(s)cd ~/Library/Preferencesrm com.apple.Finder.plistrm com.apple.Dock.plist# delete all preferences (except hidden ones)rm -rf ~/Library/Preferences/*# identify hidden preferences (which can then be deleted individually as above)# leave ".", "..", and if present ".localized"ls -al ~/Library/Preferences# delete all preferences, including hidden ones (green lines are for Leopard only)cd ~/Librarychmod -N Preferencesrm -rf Preferencesmkdir Preferencestouch Preferences/.localizedchmod +a "group:everyone deny delete" Preferences# resume your original identity when you're done being borislogout
Notes:
  • Don't forget to scroll the codebox above. It's not all showing.
  • Leopard installs an ACL on most of the pre-installed folders to keep you from deleting them. The 'chmod -N Preferences' command temporarily removes that ACL. We put it back later with the 'chmod +a ...' command, so as to leave your system in a standard state.
  • Some applications hide their preference files by prefixing them with a period. Those names become invisible, even to the wildcard *. The -a flag to ls forces invisible items to be listed.
  • The '.localized' file that we create inside Preferences is to ensure that if you switch to a different language, Finder will properly translate the folder name "Preferences". Without that, the folder name would be stuck in English.
  • I don't use 'sudo' anywhere above, because user 'boris' is not necessarily an admin. Once you do the 'su -l boris', you are boris, and lose whatever privileges you previously held (until you logout).
This is all easier than it looks.

#10 ganbustein

ganbustein

    Super Mac Geek

  • Members
  • 100 posts
  • Location:Berkeley CA

Posted 13 April 2008 - 09:27 PM

The '.localized' file that we create inside Preferences is to ensure that if you switch to a different language, Finder will properly translate the folder name "Preferences". Without that, the folder name would be stuck in English.

It turns out that "Preferences" is not one of the folder names that gets localized. Adding a .localized file has no effect, either good or ill. We might as well skip that step. (The full list of folder localizations can be found in /System/Library/CoreServices/SystemFolderLocalizations. Pick the .lproj folder for the language of interest, and examine the corresponging SystemFolderLocalizations.strings file contained within. It's a text file, and under Leopard you can just use Quick Look.)

That means the correct procedure for deleting the entire preferences folder, after using su to log in as boris, reduces to:
# delete all preferences, including hidden ones (green lines are for Leopard only)
cd ~/Library
chmod -N Preferences
rm -rf Preferences
mkdir -m 700 Preferences
chmod +a "group _linenums:0'># delete all preferences, including hidden ones (green lines are for Leopard only)cd ~/Librarychmod -N Preferencesrm -rf Preferencesmkdir -m 700 Preferenceschmod +a "group:everyone deny delete" Preferences

And if you don't mind losing the ACL on the Preferences folder, then even simpler is to just:
sudo rm -rf ~boris/Library/Preferences
from an admin account that is not boris.

If you have such an admin account available, and all you need to do is delete a few specific preferences, then for example:
[color="#000080"]sudo rm ~boris/Library/Preferences/com.apple.{Finder,Dock}.plist




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users