Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeffrey Tummers 5 posts 107 karma points
    Mar 31, 2016 @ 14:03
    Jeffrey Tummers
    1

    Move media directory to other drive

    Hi all,

    I'm looking into moving the ~/media folder to another drive on the same machine. The Umbraco version used is 7.4.2

    What I've tried sofar:

    1) Setting the umbracoMediaPath in the appSettings (docs), no longer used since 4.9

    2) Modifying the /config/FileSystemProviders.config, but I can't figure out the correct values (source), my config currently looks like this:

    <FileSystemProviders>
      <Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
        <Parameters>
          <add key="rootPath" value="e:\Media" />
          <add key="rootUrl" value="/media" />
        </Parameters>
      </Provider>   
    </FileSystemProviders>
    

    3) Created a virtual directory in IIS, now the images show up when browsing the site, but in the backoffice the Media section is empty

    Could someone please tell me what it is I'm doing wrong? Any help is appreciated!

  • Jeffrey Tummers 5 posts 107 karma points
    Apr 01, 2016 @ 08:37
    Jeffrey Tummers
    101

    As it appears I was overthinking the problem :(

    The simplest solution for moving the media folder to another drive is:

    1. Create the directory on the other drive and give your app pool user read/write rights there
    2. Create a virtual directory in IIS with the name 'media' and point it to your just created directory

    That's it, no need to change any config files!

  • Simone Chiaretta 134 posts 541 karma points c-trib
    Oct 21, 2016 @ 07:23
    Simone Chiaretta
    1

    I saw you found already a different solution, but I encountered the same problem and wanted to share my solution.

    Basically, relative urls are stored in the database in the umbracoPath property of the media item, so if you change the rootUrl property it will only apply to newly uploaded files. Old files will still remain under the old path, so if you move them to the new path, nothing will work anymore.

    Solution is:

    1. change config
    2. move old media files to new path
    3. rename the relative url of all old media to the new url (in DB or using the MediaService

    HTH Simone

Please Sign in or register to post replies

Write your reply to:

Draft