Forum Discussion

GuidoNeubecker's avatar
GuidoNeubecker
Copper Contributor
Nov 28, 2023

Re-locate ost-files

Hi everybody,

we have a customer with a default ost-file location to the Homedrive of the user because they used Citrix in the past and now using AVD.

They now want to migrate to OneDrive and disable the homedrive. In that case we want to move the ost-files back to the default location within the profile because now the profile is re-located by fslogix.

As far as I know a re-location of existing ost-files is not possible and the only way to change this is to create a new Outlook profile. 

Cannot change the location of .ost file - Outlook | Microsoft Learn

 

Does anyone have a better idea to solve that issue without less effort?

 

Thanks in advance

Guido

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi GuidoNeubecker,

    the ForceOSTPPath Registry Key and Recreating the Outlook Profile methods are mostly being used and are also documented by Microsoft in the article you posted.

    You can also use Symbolic Links or Junction Points method to repoint the file or folder where the .ost is stored.
    You can use this method to move the folder to the new location or just the data file.

    To create a Symbolic Link, you'll use the MKLINK Command line:
    - Close Outlook.
    - Move the ost-file or pst-file from its original location to its new location.
    - The default location is %locaappdata%\Microsoft\Outlook
    - Open a Command window using Run as Administrator:
    Type cmd on the Start menu, right-click on Command Prompt or cmd.exe and choose Run as administrator. 
    - Use the mklink command in this format: 

    mklink "C:\old-path" "D:\New path"


    If you are moving just the data file, you'll need to include the data filename. Quotes are required if the path contains spaces.

    For example:

    mklink %localappdata%\Microsoft\Outlook\email address removed for privacy reasons "D:\Outlook Data Files\email address removed for privacy reasons"

    When you use a symbolic link to move a file, a shortcut is created in the default folder location. If you want to revert back to the original location, delete the shortcut to break the link.


    If you prefer to use PowerShell to create the symbolic links, use the New-Item cmdlet:
    - You'll need to use quotes if the path contains spaces. If you don't want to use the exact path, call the environment variable like this: $env:localappdata
    - You will need to move or rename the original file before running the powershell.

    New-Item -Path $env:localappdata\microsoft\outlook\email address removed for privacy reasons -ItemType SymbolicLink -Value "D:\Outlook Data Files\email address removed for privacy reasons"

     

    Create a Symbolic link for a folder
    - To create symbolic links to a folder, you need to move, delete, or rename the folder you are creating the symlink for. In this example, it's the Outlook folder. If the folder exists, the powershell will error.

    New-Item -Path $env:localappdata\microsoft\outlook\ -ItemType SymbolicLink -Value "D:\Outlook Data Files\"

     

    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic
    (LinkedIn)

    • Roman_NO's avatar
      Roman_NO
      Copper Contributor

      Hi LeonPavesic ,

      I've moved my .ost file to another disk using mklink.

      Outlook works as it did before the move - I can send and receive emails, but email search has stopped working.

      I've tried all the suggestions I could find to reindex emails, but nothing has worked.

      I returned the .ost file back to its original location, and search began working again!

      Do you have any suggestions for making email search in Outlook work after moving the .ost file with mklink?

      Best regards,
      Roman P.

    • GuidoNeubecker's avatar
      GuidoNeubecker
      Copper Contributor
      Hi Leon,

      I don't think that this will work because the original path will no longer be available after migration to OneDrive.
      Current path to the ost-File H:\Oulook\email address removed for privacy reasons.
      The Outlook-profile contains the path H:\Oulook\email address removed for privacy reasons.
      After I moved the ost-File into the user-profile I need a symbolic Link at "H:" that re-directs to the new location of the ost-file, but "H:" will be removed after migration.
      When i start Outlook after migration it will open the ost-file at H:\Oulook\email address removed for privacy reasons but "H:" is not mounted anymore and the symbolic link can't reached.

      Am I right?

      Best Regards
      Guido
      • LeonPavesic's avatar
        LeonPavesic
        Silver Contributor

        Hi GuidoNeubecker,

        thanks for your update and your response.

        I have read your response carefully and I must say that you are right, if the original path (in this case, "H:\Outlook...") will no longer be available after migration to OneDrive, using a symbolic link or junction point may not work as expected.

        Perhaps you could try creating a new Outlook profile with the desired data file location after the migration to OneDrive.

        Please click Mark as Best Response & Like if my post helped you to solve your issue.
        This will help others to find the correct solution easily. It also closes the item.


        If the post was useful in other ways, please consider giving it Like.


        Kindest regards,


        Leon Pavesic
        (LinkedIn)

Resources