X
Tech

Copying user profile data, Windows vs. Linux

One of the most common tasks I face is copying profile data among computers, in both Windows and Linux. And as you would expect, both operating systems handle the profile data very differently.
Written by Chris Clay Clay, Contributor

One of the most common tasks I face is copying profile data among computers, in both Windows and Linux. And as you would expect, both operating systems handle the profile data very differently. In GNU/Linux, the copy process is very easy. Simply place the entire user's profile folder under the /home filesystem, and as long as its name matches the username, it will be picked up and used when the user logs in. You can make the profile folder different than the username, by editing the file /etc/passwd with the full path to the user's folder. You will also want to ensure permissions are in tact for the profile folder as well, mainly all that is needed is to run the "chown" command to assign the correct user.group ID to the /home/user folder, and apply it recursively with "-R". For example:

chown username.usergroup /home/user -R

That's it, and you're done, simple as that.

In Windows, it is not this simple. For whatever reason, when copying and placing a profile folder in c:\users (similar location to /home on GNU/Linux) most of the time Windows 7 will reject the profile folder and either create a new profile folder or a temporary one where no settings are saved at logoff. I've also seen Windows completely erase what data was in the old profile folder and replace it with brand new data, so be sure to have a backup copy of the profile folder handy. In Windows XP, results were hit or miss as well, sometimes it would work and sometimes it would not. XP also had the "Copy To" option in the "User Profiles" section of Computer Properties this has been disabled in Windows 7.

Why oh why does this need to be so complicated?

After stumbling around for a while, here's the method I've found to work in Windows 7.

1. Log in as the user you wish to load the profile for so that Windows creates a new profile folder in the c:\users folder.

2. Log out (or reboot as sometimes items will continue to be "in use" even though the user is not logged in).

3. Log in as an administrator and copy the contents of the old profile folder into the new profile folder generated. Check permissions on subfolders to make sure permissions are inherited from the root profile folder which has full permissions assigned to the user account it is for.

4. Log in as the user and see if it pickes up the profile. If not, go in to the registry, and remove the entry containing the path that Windows thinks it should be. Navigate to:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

and locate which SID folder that applies to the profile you wish to load. You will have to go into each SID folder and look at the "ProfileImagePath" value to see which profile is which. Once you locate the one you wish to load, remove the SID folder itself in the registry path above (S-*-*-*-**-******...). Now when logging in again, you can hope that Windows loads the profile folder in place.

Conclusion:

Lastly, I'm sure there will be some that will be quick to ask "Why didn't you just use the built-in tools, recommended by Microsoft, to copy the profile data?". The answer to that is that I did and they just don't work. I've been in circles with the "Windows Easy Transfer" application which looks nice and is very easy to use, but it fails to work at all, right out of the box. Microsoft recommends this to copy profile data from one PC to another. It looks nice and has a very nice and clean interface, but every time I've used it, it will connect and churn for a while, then after a few minutes reports the error "Windows Easy Transfer is unable to continue. Please reboot the computer and try again." on the screen of the old and new PCs. I've done the Microsoft way and rebooted many times, but the same error comes up every time.

Searching for this error comes up with a list of "causes" but unfortunately I don't have the time and effort needed to go through and test each one, when I found a workaround that actually seems to work (for now).

This kind of task is so common that Microsoft really needs to put some effort in to making this seamless. Windows PCs need to be re-imaged on a regular basis, and having a good solid tool in place to migrate user data from one PC to another would be very much appreciated. I have seen some 3rd party tools out there, so far I have not started to look at each one and test them to see which ones are worthwhile, that is a task for another day.

Editorial standards