2

(Please note the following steps I followed, as far as I can tell, are identical to Apple's instructions here: https://support.apple.com/en-us/HT201548 - note that the order in which you'd follow Apple's instructions as of this date is first the "Rename the home folder" steps 1-4 and then on into "Then rename the account" and skip the "macOS Ventura or later" on down to "Earlier versions of macOS" and follow those steps 1-7. I am posting my question because I do not see a differential that should create the failure that I'm experiencing.)

In macOS 12+ in a scenario where you need to rename an account (including its actual filesystem path/folder name) vs creating a new one and copying things over, why does the following fail by seemingly losing settings and screwing up preferences, etc?:

  1. Login as another admin user
  2. Open Terminal.app and cd /Users/; sudo mv old_shortname new_shortname; sudo ln -s new_shortname old_shortname
  3. Open System PreferencesUsers & Groups
  4. Authenticate / unlock System Settings (lock icon) for admin access
  5. Right-click user to rename → Advanced Options...
  6. Enter the new Account name and Full name
  7. Enter the new path in the Home directory field (eg, /Users/new_shortname)
  8. Save by pressing OK and reboot system

Upon doing the above and adding a symlink in hopes of reducing problems, the user is faced with missing general and app preferences, desktop wallpaper, on and on.

Reverting these changes kinda gets the user back to the way they were with some missing preferences for apps that tried to startup during the attempt and so forth.

What is the proper way to rename a user as desired and in the way it seems as though it should have worked above such that all settings, preferences, etc. are retained?

ylluminate
  • 5,311
  • Thanks for sharing, but unfortunately no @Allan, I need to also change the home folder destination as well as outlined above. – ylluminate Dec 23 '22 at 08:13
  • Why add symlinbks - just do the mv - possibly do the rename bfore the mv. (strictly why do you need to rename the directory - no scripts or other processes should be using the name - rather they use ~ or $HOME) – mmmmmm Dec 23 '22 at 08:45
  • The would be fine, but the user has some hard coded paths within various other symlinks in their home + dot files include some full paths... The symlink's just a safety net until those things get resolved. The reason they actually want to rename the home directory is that this is from a loved one that has died and they want to not have additional reminders where possible due to the painful morning and simultaneous requirements to work and see this regularly in Terminal, etc. – ylluminate Dec 23 '22 at 08:51
  • Then you are going to have to find all those symlinks and change them – mmmmmm Dec 23 '22 at 09:47
  • They will change later, yes, but the main thing is simply at first to get the main thing done quickly and pointing to the new shortname. A command like this will get the symlinks for renaming anyway find . -type l -lname "*old_username*" -exec sh -c 'printf "%s -> %s\n" "$1" "$(readlink "$1")"' _ {} \;so that's not a huge problem, but again, a simple illustration as to why I think it's a good idea to put a symlink to make access to the old path simple for the beginning of the process. – ylluminate Dec 23 '22 at 09:56
  • https://support.apple.com/en-us/HT201548 – nohillside Dec 23 '22 at 10:32
  • @nohillside yeah... so here's the rub with those instructions: when you actually follow those steps you'll see that they are precisely what I did above. The only difference is that I used the shell/Terminal instead of Finder - but there should be absolutely no differential there. Do you see something I don't? – ylluminate Dec 23 '22 at 17:57
  • We don't know what the "Users&Group" pane does in the background. How did you change the home directory of the user with dscl? – nohillside Dec 23 '22 at 18:28
  • Well note how I did in fact use the Users & Groups panel at step 3 in my steps above. The only thing I did differently (that Finder doesn't manipulate either) from Apple's steps are the first Rename the home folder steps 1-4 since I did those in Terminal, but the actual latter steps wherein Apple's Users & Groups pane trigger whatever they trigger (such as dscl, or whatever else, etc.) in the background are intact as you're suggesting... – ylluminate Dec 23 '22 at 18:32
  • Ah, right, did miss that. – nohillside Dec 23 '22 at 18:37
  • Anyway, if you do it the way Apple recommends, does it work then? If we know this, we at least know whether the instructions in general are wrong, or the approach you take misses a step. – nohillside Dec 23 '22 at 18:38
  • Unfortunately @nohillside the problem with following Apple's instructions precisely and not using the Terminal as I did is that Finder, when using it as an administrative user, still does not have a "Rename" option that functions. Their instructions simply appear broken/incomplete since they tell you to use Finder to perform the rename. Even their linked instructions do not cover a method to rename a folder that requires admin permissions. It does say "When prompted, enter the name and password of the administrator account that you used to log in" - BUT doesn't tell you how to trigger rename. – ylluminate Dec 25 '22 at 01:53
  • And to add to that (the only way I know how to trigger authentication potentially for this): In the Finder method I also got info (cmd-i), authenticated (lower right padlock; password of admin user), and then attempted to click the name at the top of the folder to rename and when that did not work, I also clicked the disclosure arrow beside the "Name & Extension" section and the text field that contains the name of the home folder was unable to be selected / changed there either. – ylluminate Dec 25 '22 at 05:06
  • Not sure I understand. Renaming a folder in /Users works the same as for any other file/folder: As an admin user select the folder in Finder, press Enter and type the new name. After pressing Enter again you get prompted for the admin password. – nohillside Dec 25 '22 at 08:56
  • Hmm, it's not functioning as such here in this way and in this case so no, neither this way nor with what I outlined. Hum. – ylluminate Dec 25 '22 at 10:34

0 Answers0