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

MG 2.0 How to specify MG volume on local server

#1
Hi,

New to XF.
Running V2 Beta 5. with Media Gallery
Digital Ocean Droplet.

Can I specify a different storage location for images in posts as well as images in the the Media Gallery? I'm not looking to use AWS etc at this stage, instead will probably be adding an additional volume on Digital Ocean.

Thanks for any help.

Chris
 

Chris D

XenForo developer
Staff member
#2
XF uses the same attachment system throughout whether the files are for posts, media or other content types.

It is possible to set the externalDataPath and internalDataPath in your config.php so you could indeed specify a different volume that way.
 

Chris D

XenForo developer
Staff member
#4
Once the new volume is set up, just move the existing data and internal_data directories to it and then change the config values. Those values will apply to existing files too and they will also get served from the new volume.
 
#5
Once the new volume is set up, just move the existing data and internal_data directories to it and then change the config values. Those values will apply to existing files too and they will also get served from the new volume.
Thanks, almost working.

I changed the config file settings to point to my data volume and everything appears to work ok except thumbnails in XFMG2.0-Beta 5 galleries.

The image uploads to the new location ok and is stored and is displayed, but the url to the thumbnail still points to the old data location. I don't think the thumbnail is being written to the new location either. But as I say, the full size image is being uploaded ok. Images in posts are working fine too.

Is there a setting for thumbnails? Although I am assuming they should be stored relative to the new location.

I've rebooted server. Rebuilt caches etc.

Edit: Permissions set correctly on new locations.
 

Chris D

XenForo developer
Staff member
#6
There's another config setting to specify the external data URL, which is $config['externalDataUrl']. That defaults to data so that might need updating.

Gallery thumbnails are stored in data/xfmg/thumbnail so that should have now changed to <new location>/xfmg/thumbnail.
 
#7
Thanks.

If I change the $config['externalDataUrl'] to the new data location (same as $config['externalDataPath'] I am assuming), I get a 500 error and forum refuses to load.

I don't want to bog the team down with issues which might be related to the Beta status of the software. So if necessary am happy to revert to local storage until XF2 is released - but am wondering whether this might be a bug.
 

Chris D

XenForo developer
Staff member
#9
If it is a bug then far from bogging us down we'd want to get to the bottom of that.

It could be a configuration issue but I'm not totally clear on what config you've tried or should work in your environment. Feel free to post some obfuscated examples here of the paths and URLs that should work / what you've entered or if you'd rather, feel free to start a conversation with me with the exact details.

I'm sure it's something we can get figured out.

Also, where can I find documentation telling me what the difference is between external and internal data?
External data is stuff that should be accessible externally. This is basically things like avatars and thumbnails.

Internal data is stuff which cannot be accessed directly. Full size attachments is a good example of this -- they are only accessible via special URLs (which checks permissions etc.) and not available externally.