MG 2.0 How to specify MG volume on local server

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
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
XF2/XFMG with mapped image volume.

Hey again - ancient thread resurrection. This question relates to installations with external/mapped image volumes as per the discussion above.

I have installed a slider add on and notice the author (@Ovunc Dinc) is saving images to the correct mapped external volume on my server, but is attempting to read/load images from the original, non mapped /data directory.

Is there a special path that add ons should use to read images from a mapped image volume (as discussed above)? By that I mean, is there a path which always points to the correct image location, whether its mapped to an external volume or not?

Many thanks

Chris


Thank you for the update - but the problem is still there.

I upload Featured Icon but it is not saved on disc. There is no error in log.

Here's a short video showing problem - uploading featured icon, but not saving:

https://drive.google.com/open?id=1wJBbheVTexU9-uhAIfnBblcVWituPPDl

Edit:

I think I have found the problem.

Xenforo allows use of alternative mapped external volume and images will automatically be saved there. Possibly? you have to change code a little to make sure you read correct abstracted path? I think this is case for all XF installations using external images store like Amazon etc.

This is mapped volume below and Slider saves icons there correctly.... bit not reading from there :)
View attachment 176226

And final edit:

I can confirm.

1/ Slider correctly saves images to mapped volume

But

2/ tries to read from: /data/XenGenTr/xengentr_resimlikonular

I think you need to make sure you are using correct read path for images... :)
 
Top Bottom