How to relocate user profile folder to other drive in windows 7
Posted on May 20, 2009
Bydefault,windows 7/vista put all system data and user data on the same partition,normally it’s drive C.Under this condition we must backup our user data every time we re-install our windows 7/vista.From windows vista ,Microsoft supply us a tool mklink which can create a symbolic link under windows 7 or vista just as the command ln under unix/linux.Below is an example about how to put user data on non-system using mklink in windows 7.
1.Enable administrator account and set a password for it.You can refer How to enable or disable administrator account in windows 7
2.Logoff and login with administrator account
3.Relocate your user data to other non-system partion,for example from C:\users\J to D:\users\J
4.Use mklink to create a symbolic link from C:\users\J to D:\users\J
mklink /D C:\Users\J D:\users\J
5.Re-login use your own account,you will find nothing changed,but in fact your physical user data is on drive D.
6.Done.The next time you re-install your OS ,just use the same user name, remove C:\users\J then run the command of step 3 again then your user data is back.
source:How to move user data folder to non-system partition in windows 7/vista
Popularity: 100% [?]
» Filed Under Windows
Comments
13 Responses to “How to relocate user profile folder to other drive in windows 7”
Leave a Reply
That’s really help. I didn’t know that use profile folder can be relocate before.
Didn’t work properly for me. Couldn’t load some office programs or live messenger. There must be another way?
Hi.
This works flawless untill you start with step 6. After re-installing your Windows 7, and use your old profile directory on the other disk. You wont be able to login to that account anymore, right after you’re trying to login you get “login off”.
Anyhow, what i found is, when you copy the new profile map with your name (the one you just created while re-installing windows7) , and move that one to the other disk and put the old data in from your previous profile directory. Then it would work. I couldn’t fine anything so far.
Same as when you have made the mklink to the other disk, and instead of copying the profile from C:\ drive to the D:\ drive you create the profile map on the D:\ and copying all the old data in this new created profile map. And when you then try to login on to this account, it would create a TEMP account map in your C:/users/ instead of using the linked directory.
I tested this on Windows 7 Ultimate RTM instead of the evaluation version, and Julian was right. Somehow most of the applications are getting corrupt.
Hi,
I’ve been using Win7 RC7100, and I’ve used the mklink command. It’s touchy, it seems, and after re-installing the OS, it isn’t as simple; I’d have to rename my user profile, let Win7 create the new one, and then copy everything over from the old to the new.
However, above and beyond that, my main question is in regards to permissions. It seems as if all the user directories on D: are “open” to whomever logs in. Even though the C:/User/Name may be locked to the individual, the D:/User/Name, to which the symbolic link points, is not. I haven’t tried playing with permissions (I haven’t been that brave yet), but any pointers as to how to rectify that situation would be helpful.
Thanks
To most easily move all user files and user program files off your boot drive (an SSD in my case), follow these instructions.
FIRST, Create a restore point:
1. Open System by clicking the Start button, right-clicking Computer, and then clicking Properties.
2. In the left pane, click System protection. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.
3. Click the System Protection tab, and then click Create.
4. In the System Protection dialog box, type a description, and then click Create.
THEN: Go to System Recovery/Command Prompt:
Boot with the Win7 Install DVD, choose language, currency and keyboard, and hit Next.
At the screen with the “Install Now” choose “Repair your computer”
You will be asked if you want to “Repair and Restart” by the System Recovery options, choose “No”.
Then Make sure that Windows 7 is listed as one of the installed OS’s available for recovery, and that it’s selected and then press next.
You will be given a list of recovery tools.
Choose “Command Prompt”.
Find your virtual Windows drive loaded from the Win7 media (probably either C or X), find your actual Windows/SSD drive (D or E) and find your HDD (regular hard drive) (D or E).
In my system normally, C=SSD with Windows on it, D=HDD data drive
Using Win7 Update media, the drives in Recovery mode were set up differently, thusly:
X: virtual/temp Windows drive,
E: actual Windows/SSD drive,
D: HDD, hard drive I wanted to put \Users on.
Some report that System Recovery mode will set up their drives like this:
C: virtual/temp Windows drive
D: Actual Windows/SSD drive
E: HDD, they want to put /Users on.
In the command prompt you will be using Robocopy (NOT xcopy!) to copy c:\Users to d:\Users, then delete the old c:\Users, then make a symlink from c:\Users to D:\Users. Note that you must do these things in order, and you must not have a d:\Users dir before you do this.
NOTE: in the system recovery command prompt window, your drives are not the same as they will be after you leave recovery mode! So adjust the commands below for how the drives are in Recovery Mode, and then they’ll turn out correct later.
I used:
robocopy /mir /xj E:\Users D:\Users
To move /Users from Windows/SSD to HDD.
/mir tells robocopy to mirror the directories, this will copy all files and permissions.
/xj is very important, this tells robocopy not to follow junction points. If you forget this, you will have a lot of trouble.
Make sure no files failed to copy (FAILED column = 0).
Then you must remove the old Users Folder from the Windows/SSD (c:) drive, before you can create the symlink:
I used:
rmdir /S /Q E:\Users
Create a NTFS Junction/symlink that points to the new Users folder:
I used:
mklink /J E:\Users D:\Users
Use the /J switch to create a junction that’s a hard symlink. (If you use the /D switch, you’ll also have to edit the registry, cuz it won’t be a hard link.) Using /J, when Windows looks for the C:\Users dir, it will find it! But it will be on the HDD instead of the SSD. Tricky!
To see the proof of what you’ve created, still in the command prompt window, go into the actual Windows/SSD and do the “dir” command, and you’ll see:
” Users [D:\Users]”
Now restart and you’ll see /Users on your HDD, and there you go. No further configuration or fiddling required. New user profiles will all be stored on the d: drive, as will any user specific data. And it is achievable without any messing about in the registry, searching and replacing values, or having to mess with new profiles in any way. Totally set and forget.
I just ran through ohdannyboy’s procedure for moving the users folder and it worked. Thank you for that. But rather than booting from the install disk, I was able to enter the ‘System Recovery Options’ through the ‘Advanced Boot Options’ screen, (pressing ‘F8′ repeatedly during boot up will get you there). Once in the Boot Options screen, select ‘Repair Your Computer’. This will get you to ‘System Recovery Options’ – at which point you can proceed as per ohdannyboy’s instructions. This method will only work if the original installation created a ‘Recovery Partition’ – which should be present if the system was purchased with Win7 preinstalled.
Once the change was made, rebooting brought me to a warning screen telling me that something got screwed up and gave me the options of repairing or starting normally. I selected the latter and held my breath until my desktop came up normally. The first application I tested was Outlook 2007. It complained that it could not find the .pst file and asked me to point it in the right direction (C:\users\yourACCOUNT\AppData\Local\Microsoft\Outlook\outlook.pst). Outlook restarted mostly successfully – it did not know what to do with some of my rules. The rules where still present, so I simply stepped through them until I got to the ‘Apply’ button. I didn’t actually change anything, but it fixed the problem. Even though the ‘users’ folder was moved to the D: drive, Windows apparently still reports it as being on the C: drive. So I don’t know why Outlook had to be redirected – the path, as noted above, is the same as it’s always been.
Whatever, it works.
By-the-way, it appears that the search index did not need to be refreshed – a big relief. Windows 7 continues to impress me.
imadman and ohdannyboy, thanks a lot for the workaround. It works great.
It’s a shame that Microsoft makes us tanker around instead of providing a neat standardized solution to the very common wish to separate OS and user data…
I’ve found an easier and safer way to move everything but AppData. There may be a way to get that working too, but I’ve had some trouble there (just that it won’t complete the move using my method).
Here’s what I found: Make a folder on your data drive. Let’s use the name Bob in my example. So I make a folder D:\Bob. In there I make the following sub-folders: Desktop, Docs, Favorites, Music, Videos, Pictures, Downloads, Contacts, Links, Saved Games, and Searches.
Now I go to C:\Users\Bob\Desktop, and right click on Desktop, calling up Desktop Properties. I click the Location Tab, select Move, tell it to use D:\Bob\Desktop, and it moves everything, telling Windows where it will be from now on. I do that for each of these folders. Now the bulk of my data will reside on Drive D:, with no subsequent issues. I should mention that I’m using Windows 7 64 Bit Home Premium.
I looked online, but I didn’t saw this method written up anywhere (although it almost certainly is). Yesterday, I was on a Vista machine, and I noticed the Location Tab there as well. But not all folders in Windows 7 (and Vista, I assume) have Location Tabs. I wish AppData did, and I wish Program Files, Program Files (x86), and Program Data did as well.
In the AppData, you can choose the Location Tab on Local, LocalLow, and Roaming, but it doesn’t work right, or at least it didn’t for me. Mine couldn’t copy UsrClass.dat, UsrClass.dat.Log1, and UsrClass.dat.Log2, because all were in use by the System. So it canceled the move. I am doing this on an Administrator account. I also ran Explorer with Administrative privileges, but that didn’t work either. I might have tried too many times, because I can’t get the Location Tab to show back up on any of the AppData folders anymore.
Perhaps the RoboCopy, mklink method would work for someone else with those folders. I tried ohdannyboy’s method for the entire Users folder, but it busted my User Profile so that I couldn’t log back in, except in Safe Mode with the default profile. But I had created a Registry back up with ERUNT, so I just restored that and all was well. I tried it several times, but always with the same results. I don’t know why that wouldn’t work for me, but I’m glad I at least have all the User Data folders easily moved over to my data drive now. I may try the RoboCopy, mklink method just for AppData, but I haven’t yet. Well, I hope someone else finds this useful. God bless!
This is really great. I do agree, with the advances in windows7, this should be something present during the install options AND a utility within the system administration options called something like “User Data Migration Tool”…as a matter of fact, someone could probably make a lot of money writing a program to do this for the folks that don’t like to tinker. Anyways, I’m gonna see if this works for the “Program Files” folder as well. Don’t see why not. Keep you posted.
I followed ohdannyboy’s instructions & though they are excellent it didn’t work for my case. It will work when the target drive has the same letter under the Recovery Environment as in your live system. In my case the target drive is T: You can create a link to D: (the drive letter in RE) but the link won’t work when you go live. You can’t create a link to T:\… because T: doesn’t exist. I got around it by renaming the drive in diskpart in RE(to T:) but I guess using SUBST would work and be easier.
Thanks
Laurie
[...] successfully (and invisibly) done this on Windows 7 64 by using instructions on this forum thread: How to relocate user profile folder to other drive in windows 7 : Tips5 Note: ignore the main article! scroll down to the comment from "ohdannyboy on December 4th, [...]