XF 2.2 Gallery migration: Attachment files in /data/attachments

Plati

Member
For my migration from phpBB Gallery to XFMG I have some questions about the attachments in /data/attachments.

I assume under internal_data/attachments are the original files (source). What is that under /data/attachments? Thumbnails? Whereas under /data/xfmg there are also thumbnails.

I noticed that even without the image file being under /data/attachments, the images seem to be displayed correctly in the XFMG. So what are the files needed for?

Are there any specific requirements for the files in /data/attachments (size, format)? Also, if I upload e.g. a png file, does XenForo always create a .jpg there? So do jpg always need to be created in that directory?

Is there maybe a way that XenForo creates the files in /data/attachments afterwards from the source files?
 

Mike

XenForo developer
Staff member
What is that under /data/attachments? Thumbnails? Whereas under /data/xfmg there are also thumbnails.
They're both thumbnails. The former is a more generic attachment thumbnail, whereas the latter is XFMG specific. They're generated with different settings.

Your best bet is probably to look at one of the existing MG importers to see how they create media items. If you use the same approach, most of this stuff should be handled for you (using the correct size, format, etc).
 

Plati

Member
Where do I find the existing MG importers? From my point of view I only find the forum importers in the addon.
However I am not sure yet whether I can do anything with it because I will do the migration with a data import/export, not with a specific script.
 

Mike

XenForo developer
Staff member
src/addons/XFMG/Import/Importer has all the importer scripts.

I'm not suggesting you explicitly write an importer in that style -- though that might be the ideal -- but if you can use PHP code to use the import data handlers for media items and attachments (for example), then you'd save yourself a lot of work.
 

Plati

Member
Thanks for your answer.

I have looked at the importers but unfortunately that does not help me in my case.
I am using an external Java tool for the migration and therefore cannot execute any PHP calls. I have already worked through the handling of the media items and attachments and this works so far in my importer. The only thing I'm still missing is storing/creating the attachment thumbnails in /data/attachments.
If you could tell me what to look for in the format or size of the thumbnails, I'd be on my way.
 
Top