boloman

Copy/ Migrate User Account on same mac

10 posts in this topic

Howdy,

 

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

Thanks,

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

Do you know what's corrupted?

 

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

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites
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.

 

[color="#808080"]# log in as boris[/color]
[color="#000080"]su -l boris[/color]
Password: [color="#000080"][i]<boris' password>[/i][/color]

[color="#808080"]# example of how to delete individual preference file(s)[/color]
[color="#000080"]cd ~/Library/Preferences
rm com.apple.Finder.plist
rm com.apple.Dock.plist[/color]

[color="#808080"]# delete all preferences (except hidden ones)[/color]
[color="#000080"]rm -rf ~/Library/Preferences/*[/color]

[color="#808080"]# identify hidden preferences (which can then be deleted individually as above)
# leave ".", "..", and if present ".localized"[/color]
[color="#000080"]ls -al ~/Library/Preferences[/color]

[color="#808080"]# delete all preferences, including hidden ones[/color] [color="#008000"](green lines are for Leopard only)[/color]
[color="#000080"]cd ~/Library[/color]
[color="#008000"]chmod -N Preferences[/color]
[color="#000080"]rm -rf Preferences
mkdir Preferences
touch Preferences/.localized[/color]
[color="#008000"]chmod +a "group:everyone deny delete" Preferences[/color]

[color="#808080"]# resume your original identity when you're done being boris[/color]
[color="#000080"]logout[/color]

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.

0

Share this post


Link to post
Share on other sites
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:

[color="#808080"]# delete all preferences, including hidden ones[/color] [color="#008000"](green lines are for Leopard only)[/color]
[color="#000080"]cd ~/Library[/color]
[color="#008000"]chmod -N Preferences[/color]
[color="#000080"]rm -rf Preferences[/color]
[color="#008000"]mkdir -m 700 Preferences
chmod +a "group:everyone deny delete" Preferences[/color]

 

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:

sudo rm ~boris/Library/Preferences/com.apple.{Finder,Dock}.plist

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now