1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

RM 1.0 Change the path to folder where downloads are stored

Discussion in 'Resource Manager Support' started by Xosé Estrada, Mar 26, 2013.

  1. Xosé Estrada

    Xosé Estrada Member

    We currently use multiple disks on our server, and we would like to store the downloads (quite large files sometimes) in a folder on a different disk.

    Is this possible?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    How do I change the internal data path from the default of internal_data?
    Edit the library/config.php file and add the following:
    PHP:
    $config['internalDataPath'] = 'new_internal_data_path';
    Change the path to suit. Note that the path is relative to the installation path.


    How do I change the external data path from the default of data?
    Edit the library/config.php file and add the following:
    PHP:
    $config['externalDataPath'] = 'new_external_data_path';
    $config['externalDataUrl'] = 'new_external_data_url';
    Change the paths to suit. Note that the path is a file path (it can be relative to the installation path) and the URL is how the data will be loaded by users. These values need to point to corresponding locations.


    http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-180456
     
    Wulfspider, Bram and Xosé Estrada like this.
  3. Xosé Estrada

    Xosé Estrada Member

    What is the relevant one for the Resource Manager.

    We seem to be able to have or forum attachments or resource manager working, but never both at the same time...
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    All attachments are stored in the same place.

    There aren't separate directories for forum and Resource Manager attachments.
     
  5. Xosé Estrada

    Xosé Estrada Member

    I have an attachments folder on the data folder, and another in the internal_data folder.

    If I add the lines you suggested to the config, the resources manager works, but the normal forum attachments are broken links.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Are you using a cache?

    What happens with new forum attachments after you make the change?
     
  7. Xosé Estrada

    Xosé Estrada Member

    New attachments seem to work.
     
  8. Xosé Estrada

    Xosé Estrada Member

    Can you help me with the old ones?
     
  9. Xosé Estrada

    Xosé Estrada Member

    Ok I've moved both data and internal_data folders to the secondary disk.

    This is my config:

    $config['internalDataPath'] = '/mnt/1TBdrive/internal_data';

    $config['externalDataPath'] = '/mnt/1TBdrive/data';
    $config['externalDataUrl'] = '???';

    While the paths seem to work ok, the externalDataUrl seems to be not good as I can't see avatars etc.

    Does it have to be a folder reachable from the web?
     
  10. Mike

    Mike XenForo Developer Staff Member

    Yes, the data folder needs to be reachable from the web.
     
  11. Xosé Estrada

    Xosé Estrada Member

    Ok, we are using the line on config for the internal data and a symbolic link for the external, and it's working :)
     
    DeltaHF likes this.
  12. Sadik B

    Sadik B Well-Known Member

    Hi Mike. I am doing the same thing here for a client. I just want to confirm,

    I have copied the data and internal_data folders to a separately mounted storage disk. So if I don't change the config path variables, can I just create two symbolic links inside the xenforo directory for both the data and internal_data folders and be done?

    OR... is it better to change the config['internalDataPath'] to the actual path and use symbolic link for $config['externalDataPath'] ?
     
  13. Mike

    Mike XenForo Developer Staff Member

    A symlink should work, but in terms of the paths, you might as well just use the real paths -- there's no real advantage to using the symlink. Note that there's an external data path and URL. The URL is what'll be used. You could expose your external mount with whatever URL you want or you can use a symlink to make it accessible at the default URL.
     

Share This Page