Skip to main content
Recent Posts
Feature Discussion / Re: Attachment hashing
Last post by Spuds -
Nope 1.1 is still the same-ish ... 2.0 is where we have been discussing overhauling the attachments code which has kind of defied refactoring and may just needs to be redone.  Its really true spaghetti.
Feature Discussion / Re: Attachment hashing
Last post by ian -
That's my suspicion too. I fully imagine it's inherited from SMF. It's very 2008 php. I have not upgraded to elkarte 1.1.x so maybe it has changed.
OpenImporter / Re: [Solved w/script] Best bet for phpBB 3.0.x -> ElkArte 1.0.x?
Last post by ian -
Concentrate on ElkArte. I'll put this in git eventually and others can push updates there. I think for big forum moderators with software this old an automated convert is really making things much more difficult than they need to be.  I mean if we use ElkArte we'll plan to stick with current version for 8 years or so. If we can update, great, but nothing is worse than being stuck with phpBB full of hand mod hacks that can never be upgraded.  It's a super nice idea though and I totally get it.
Feature Discussion / Re: Attachment hashing
Last post by Spuds -
Its just security, same as the .elk type which is AFAIK not used by any executable.   So someone uploads a file and its gets hashed to some name they can't find, or should not be able to find.  Then the extension is also to prevent it from being seen as an executable or any file used by an installed program.   I think that is all the reasons @emanuele ?  There are some less than secure setups around so some things were done just to protect people from themselves.
OpenImporter / Re: [Solved w/script] Best bet for phpBB 3.0.x -> ElkArte 1.0.x?
Last post by ian -
Oh, wanted to add... This converter does not depend on a working install of either forum, per se. No forum files are included, everything is set manually in the Importer.php process() function. However, avatar paths, avatar salts, upload paths, attachment paths are all pulled from the database of both forums, so things need to at least be at the locations indicated if you care about importing files.

This solves a lot of my issues because it feels like the converters are being too cute when trying to find the prefix and dB names and stuff.
Feature Discussion / Attachment hashing
Last post by ian -
The attachments are currently stored as attach_id-hash.elk Is there a reason for that? My guess is security through obscurity? In my recent sites we follow the laravel model of having a /public/ folder for accessible stuff and everything else is in the directory above. Our sites are all in git and we just use Apache virtual directory to point at where ever the public folder of the repo is on the server. It's pretty sweet. Then only public is exposed and we keep all kinds of development and testing resources in the non accessible upper folder.

So for example attachments would be one directory above public and out of the web root. The script reads them out and dumps to browser. Then instead of all the silly hashing we just use base 36 numbering to maximize the address (name) space. Any security is implemented in the access control layer (eg, who can read, for PMs maybe recipient, sender, and admin). It looks like the images are already dumped via php so this isn't a performance hit.

I'll have a look at how feasible as I get our test migration into git and deployed on a live server.
OpenImporter / Re: Best git branch/forum attachment for phpBB 3.0.8 -> ElkArte conversion?
Last post by ian -
I hacked OpenImporter and this is the carcass that remains... Its just a class full of functions that convert various stuff. My phpBB3.0.8 forum converted perfectly (?) to ElkArte 1.0.10.

Now that I'm familiar with OpenImporter and the SMF Convert scripts, I think these changes could all be put into the open importer xml, but I didn't do it that way. I think for my situation (8 year old phpbb3 desperate to migrate, there's gotta be tons of us) it was best to use something that is straight forward and easily tailored to the individual install.

The OpenImporter phpBB3 XML lacks a bunch of stuff that is in the SMF convert SQL. The SMF convert SQL (master and development) lacks really crucial updates to be at all usable. This package includes every update I could find on the web, as well as a bunch of stuff I noticed (subforum handling is a disaster in everyone's scripts! Only slightly less so in mine!).

This has no interface. Just edit the values in Importer.php and run import.php. I suggest commenting out every step and doing them one at a time. I ran it from my web browser on a laptop with a fairly large forum and gigs of attachments, but I'll probably run it from CLI when I do the live server.

There's no problem with running the conversion multiple times, or even partially. It totally clears out the tables used before each step, and the steps are not interdependent on each other for the most part.

Prevent multiple copies of attachments: delete the attachments, pm_attachments, and avatars (probably in attachments...) before running import_members() or import_attachments() a second time. The files have a unique hash so a new set of files is imported each time. If you don't clean these folders you'll end up with multiple copies and no way to tell which is which without writing some code... However, you can clear the folders and then run import_members() (clears the attachments table and adds the avatars) followed by import_attachments() to import again.

import_boards function
: Beware when importing subforums. The script does the top boards and first layer of sub-boards only. Boards 2 levels deep and lower will go into a new "MANUALLY SORT ME" category so you can fix them yourself.

$my_member_name='';:  Enter your member name here to reset your password to 12345 after the member update. This makes testing much easier because you don't need to do the password reset after each run.

import_attachments: phpBB3 has Private Message attachments but SMF (& ElkArte?) do not. Post attachments go in the attachment table. PM attachments go into a NEW table that the script creates (pm_attachments). Supposedly this can be used by a SMF attachments in PM mod... $pm=true will import PM attachments

Empty things cause errors: Every function BUT import_attachments() probably will cough up blood if there are no records (empty query) for that table in the forum.

Code: [Select]
SUBSTRING(CONCAT('phpBB ', rank_title), 1, 255) AS group_name,
rank_image AS icons, '' AS description, IF(rank_special = 0, rank_min, -1) AS min_posts,
'' AS online_color
FROM {$from_prefix}ranks
ORDER BY rank_min;"; //NOTE: rank_image AS stars for SMF, icons for elkarte

SMF compatible almost: The only difference with simple machines forum that I could find was importing ranks where phpBB's 'rank_image' is used AS 'stars' for SMF, but 'icons' for elkarte. If you changed that I believe this would also export to SMF.

Thanks so much for your help and work on both of these projects. I look forward to trying ElkArte. I hope this also helps others stuck with old, unmaintainable phpBBs.