This past Christmas, my kids received new Mac laptops. We managed to keep their previous computers working for seven years, but these new Macs will see my kids through to college and maybe beyond. New Macs meant that we had to move all their files from the older computers to the new ones.
The old machines both had macOS High Sierra installed, and the new ones have the current macOS, Mojave. Following Apple’s instructions, I started migration on both older systems to both newer ones. (It made for a lot of smiles and laughs as family members passed through the room with four Macs all chugging away at once.)
Both computers gave errors at the end of multi-hour migrations, though one pair of computers appeared to have fully transferred data. The other pair did not; it seemed to have transferred apps and system preferences, but left out the main user. This may have been due to that user having parental controls set, though Migration Assistant doesn’t warn of that being a problem, nor is there a mention in any support notes from Apple.
In my experience with Migration Assistant over the years, this kind of inexplicable problem has become ever rarer. I tried three different methods to shift that user directory over, and only the third (and very technical one) worked.
Delete and archive the account
The most obvious way to move the account was to use the Users & Groups preference pane’s option to remove an account, but archive its contents. First ensure you have a backup of the older computer. Then follow these steps on that computer. (Note that for later migration methods, you’ll return to use some of these steps, too.)
- Open the Users & Groups preference pane.
- Click the log and enter details for an administrative user.
- Select the account in the user list.
- Click the - (minus) sign.
- Make sure the first option is selected, Save the Home Folder in a Disk Image. Then click Delete User.
- This should prompt you to save the user’s directory, and then macOS will copy it to that disk image.
- Copy the disk image file via the network or an external drive to the newer Mac.
- Mount the disk image by double clicking it.
- Create a new folder in the Users directory with the name you want to use for the new account.
- Copy the entire contents of the disk image into that new directory. (You may have to authenticate copying in both steps 9 and 10.)
- When complete, eject the disk image.
- In Users & Groups, click + (plus) to create a new account. Make sure the Account Name is different from the folder you created in Users in step 9, as the Account Name is used to create the name of the folder in the Users directory.
- As described in this recent article, you “repoint” the home directory to the directory you just copied. (In brief, Control-click the new user name, click Choose to the right of Home Directory, and select that new directory. Click OK.)
- Now you need to fix permissions. In the Finder, select the new user’s folder in the Users directory and choose File > Get Info.
- Under Sharing & Permissions, click the lock icon and enter an administrative account’s password.
- Click the + sign and pick the just-created user that should become the owner of this directory and then click Select.
- Set that user to Read & Write under the Privilege column.
- Now select the gear icon and choose “Make account name the Owner.”
- Finally, select the gear icon and choose Apply to Enclosed Items and click OK. This may take a moment or several minutes.
Now you’re complete. I’d make sure fast-user switching was enabled (in Users & Groups > Login Options), and then attempt to log into the user you just changed the directory for. If you can’t log in, you may need to take one of the steps below.
For me, this option failed after step 6, with macOS refusing to delete and archive the account. I moved on to try to the next option.
Use Disk Utility to archive the user folder as a disk image
Disk Utility can create a disk image from a folder, and this seemed like the logical next step.
- Launch Disk Utility.
- Choose File > New Image > Image from Folder.
- Choose the user directory.
- Save the disk image and then proceed at step 7 above.
Again, this failed for me. Disk Utility was unable to create the disk image, so I proceeded to the next option.
Copy via a network connection
I thought perhaps the user directory could simply be copied over, bypassing the archive and disk image states.
- On the new machine, enable file sharing in the Sharing preference pane by checking the File Sharing box.
- On the old machine in the Finder, choose Go > Network and double-click the new computer’s name.
- Click Connect As in the window’s upper right and enter an administrative user and password.
- Mount the main volume by double clicking it.
- Drag the user directory you want to copy from the old machine to Users > Shared on the new computer. This bypasses permissions issues in copying.
- When complete, on the new machine hold down the Command key and drag the user directory into the main Users folder. You will have to authenticate this “move” operation with an administrative password. (If the old account matches an account that already exists on the new machine, rename the folder you copied to the Shared directory to something else before you move it.)
- Now proceed at step 12 above.
Once again, sadly, as Christmas Day progressed, this option failed for me as well. I proceeded to the most-technical option.
Use command-line tools to copy all files
Warning! It’s easy to make errors at the command line that could cause problems with your Mac, including requiring a full restore of the system and all your files. Make a complete backup and follow steps below exactly. If you’re not confident, don’t use this method.
This is essentially a “recipe” that you can follow with careful attention to detail in which you substitute in your own user account names and folder names.
Here’s how it works. An old Unix command called
tar (for “tape archive”—it’s that old) creates ZIP-like archives of files and folders that exactly capture the directory hierarchy. Just as with ZIP, when you extract an archive, the structure is reproduced.
Instead of creating an archive on disk, you can use tar to send the archive across a network connection where it’s extracted live as each file is added. It’s a kind of bizarre Unix copy operation that’s often more reliable and possible in cases where others fail.
To carry this out, start steps 1 to 4 under “Copy via a network connection.”
Now, make sure you know these four pieces of information:
- The directory name on the old machine in the Users folder. Let’s call this the OLDACCOUNT.
- The directory name you created on the new machine in the Users folder. Let’s call this the NEWACCOUNT.
- The Account Name as shown in the Users & Groups preference pane’s Advanced Options (see above for finding that screen). Call that SHORTNAME.
- The destination drive name as mounted on your old computer. Enter
ls -l /Volumesin the Terminal, and you get a list of all internal, external, and network drives. Note the full name of your destination drive. Let’s call that, NEWDRIVE.
You’re finally ready to proceed. Enter these two commands on the old computer with all those substitutions, ending each by pressing Return. Also make sure you have a single straight quote around the paths to prevent errors that can occur when spaces are in the names of users, volumes, or paths. (This is all one line.)
sudo tar cvf - . | (cd ‘/Volumes/NEWDRIVE/Users/Shared/NEWACCOUNT’; tar xf -)
With this last operation, you will likely have to enter the password for the account you’re using. (
sudo means “run this command as if you’re the ‘superuser,’ or most important account on this computer.”)
So if I’m copying my
glennfleishman user directory on my old computer to a
glenn account on my new computer, and the startup drive on the new computer is named
Amusing Drive Name, those commands would look like this. (The line beginning
sudo is all one line.)
sudo tar cvf - . | (cd ‘/Volumes/Amusing Drive Name/Users/Shared/glenn’; tar xf -)
(For those interested, the commands mean: “Change directory to the
glennfleishman location. Create a tape archive that passes the contents along to the next program in a chain instead of writing to a file on disk. For each file, first change director to the destination networked drive’s directory, then extract the archived file into the correct hierarchical location.”)
This can take a long while, even with fast Wi-Fi or ethernet, and the
v option in that first
tar in the second line stands for “verbose”: it will display a single line for every one of likely 10,000s to 100,000s of files copied.
When this is all complete, you need to move the user directory on the new machine, as in step 6 under “Copy via a network connection”: Hold down the Command key and drag the user directory into the main Users folder (ensuring first it’s not named the same as a folder already in Users), and enter a password if required.
You can then continue to proceed at step 12 in the first method above.
While steps 14 to 19 for changing permissions should work, it’s possible you’ll encounter a problem because of how the files are copied. In that case, you can use Terminal on the new computer to solve the problem. (Why is “wheel” in there? It’s a standard Unix group name used for administrative purposes.)
- On your new computer, launch Terminal.
- At the command line enter
sudo chown -R SHORTNAME:wheel /Users/NEWACCOUNT
- Enter a password if prompted to proceed.
In the case of my example above, that would look like
sudo chown -R glenn:wheel /Users/glenn
Ask Mac 911
We’ve compiled a list of the questions we get asked most frequently along with answers and links to columns: read our super FAQ to see if your question is covered. If not, we’re always looking for new problems to solve! Email yours to firstname.lastname@example.org including screen captures as appropriate, and whether you want your full name used. Every question won’t be answered, we don’t reply to email, and we cannot provide direct troubleshooting advice.