XF 1.5 Import phpBB albums -> XF1.5

SchmitzIT

Well-known member
Ohai. I'm probably back and here to stay this time after a few years of dropping off the radar (my personal life got flipped upside down, but I'm happy to report that balance has once again returned to the universe).

I'm probably just overcomplicating things, but I've been working on transforming an ancient phpbb forum into XenForo 1.5. So far, so good. I have my archived_import_log which due to this being a clean install has every thread-id identical to the old one, ditto with the post_id, so a few reg-ex "Replace in post"s should allow me to cover 95% of the existing content, as well as a phpbb_album table.

Not sure it will matter much, but the current xf 1.5 forum is a temporary thing currently running on my localhost. The final target is an existing xf 1.5 forum, which itself was imported from vB when XenForo 1 was officially launched. But I digress.

My main concern is the Albums. So I have a table called "phpbb_albums". It has a pic_id and a pic_filename. It contains a bunch more meta data, like a title, username of the person submitting it, etc, but I'm really not overly interested in that (and I'm lazy).

The url to the picture would be something like this:


In the database, that'd translate into bede6fc8edc69d2e5fac760e323d8079.png , which, going by the title and the image seems to point at the right picture in the original album_mod/upload folder. Awesome.

How would I be able to convert this into something usable by XenForo? Ideally, I'd end up simply replacing every album.pic.php?pic_id= with the path and name of the actual file. I'm more than willing to simply have these images sit in a specific subfolder of the target site, and hardcode things from there, but ideally, we'd make them go through the actual XenForo upload process, meaning they'd get added in the regular fashion where they end up within /internal_data/ like normal uploads, while any links would remain clickable or as embedded content.

I have a few possible options I can think of:

  1. Lazy me is fine with creating /internal_data/phpbb_import, and doing a mv of the files to there. I write an UPDATE sql statement where I simply replace album_pic.php?pic_id=2514 with /internaldata/phpbnb_import/bede6fc8edc69d2e5fac760e323d8079.png, and go about my happy lazy way.
  2. I'm not sure if it's possible doing an UPDATE statement with RegExp in MySQL though (and seeing I'd need to use the phpbb_album, that might be needed). It'd probably be a bit more elegant, but I'm no guru with RegExp, and seeing MySQL is a hammer, mehotd 1 is simply more familiar for me, and therefore easier to write. I'll be fine with some collateral damage in case not everything works out fine.
  3. Figure out a way to do this elegantly, meaning all uploads in the albums are properly uploaded within XenForo, links will be renamed to point at the new locations, and all will be well in OCD-Land, where the prince, his princess, and Karin from accounting live happily ever after (DAMN YOU KARIN, YOU MEDDLING *****).

I'd be happy to receive any input you'd be willing to share. I'm growing tired of the conversion (it'd been about a week), it's not a customer/paid job but something of a hobby project, so I'm not overly invested in doing things the best possible way, so option number 1 is starting to look like a great way to get things behind me. However, I'd also like to upgrade the forum from 1.5 to XenForo 2.1 (with extra spice), and am willing to do things right if that will make my life a bit easier :)

Thanks in advance!
 
Back
Top Bottom