bbPress 0.9 and 1.0: import issues?

Wildcat Media

Well-known member
A good friend of mine and fellow moderator just bought a license for XF, and we are going to work on converting two existing forums into one XF. We plan on using vB as the go-between, for obvious reasons.

As I understand, ImpEx can indeed import more than one forum instance into vB. In other words, he has some archived, earlier posts in bbPress 1.0, with the current forum running bbPress 0.9. We should be able to import the earlier forum, check vB to make sure it all imported, then do a second import to pull in the current forum.

Has anyone done an import from bbPress as of yet? What kind of issues should we watch for? Do items all import (attachments, avatars, etc.) and do users have to reset their passwords on first access? Any altered BBCode we need to run a cleanup script on?

Any advice appreciated! If there isn't any, we'll forge ahead, take notes and report back.
 
I haven't done any bbpress imports myself. But in looking at the bbpress modules in ImpEx I can see that it imports users, forums, threads, and posts. Avatars are included in the user module. I see no mention of attachments though.

What kind of issues should we watch for? Do items all import (attachments, avatars, etc.) and do users have to reset their passwords on first access? Any altered BBCode we need to run a cleanup script on?

Those are the two main problems you might encounter (user passwords and BB codes). If bbpress stores passwords using a compatible hashing scheme then ImpEx will preserve the passwords (and so will xenForo). Otherwise your imported users will need to reset their passwords.
 
Passwords would not be a problem--we can just roll with whatever happens. Not sure about attachments though--there were quite a few of them in one of the forum areas.

BBCode is something we'll have to clean up after porting over to XF.
 
Were you coming over from bbPress?

For my conversion from SMF --> vB --> XF, I only need to run two processes to fix the BBCode. I ran the utility to fix the quotes, but didn't yet do anything to the YouTube addon I had with SMF. It's a simple fix, but it was not used that often and even there, mainly in off-topic threads. Not a big priority. I'm not sure if this bbPress install had any custom BBCode or not. My partner in crime will probably check in here shortly.... ;)
 
I'm Rudy's friend who is migrating from bbPress to XenForo. :wave:

Concerning attachments... the bbPress Attachments plugin uploads the files to a directory below my public HTML directory on the server. When I go in to edit a post that has an attachment, I see something like this:

[attachment=126158,1432]

Looking in phpMyAdmin, there's a table called bb_attachments. 126158 is the field called "post_id" and 1432 is simply "id".

Here are the all the fields in the bb_attachments table:
id
time
post_id
user_id
user_ip
status
downloads
size
ext
mime
filename

I wonder if these can be imported into vBulletin?
 
Hey Keith!
roodywave2.gif


I was thinking about this earlier. I believe vBulletin stores attachments by user. And it uses some kind of extended directory structure, which looks similar to my example below. My user ID being 1392 on a large vBulletin forum, the attachments would be here:

....../attachments/1/3/9/2/slre8423l4kj3k42l

They are not stored under a "real" filename but, instead, a "hash" of characters, the idea being that a person can't point to specific images and use them elsewhere online. An attachment table aligns the file with its proper filename IIRC, along with post and user IDs.

The tricky part I'm thinking is trying to pull out a user ID to store in the attachment table. If we know post 126158, we can see who posted it, grab the user ID, then work it from there. Then we'd probably have to figure out how vB encodes those hashed filenames, and then insert the data into the vB attachments table.

Where's our Impex guru when we need him? ;)
 
I currently have two sub-folders in my bb-attachments directory.

/pathto/bb-attachments/0
/pathro/bb-attachments/1

When a file is uploaded via the plugin, a number is appended to the filename. This is what I see in the 0 folder:
1.filename.ext
10.filename.ext
100.filename.ext
101.filename.ext
102.filename.ext
etc. up to 994.filename.ext

In the 1 folder:
1001.filename.ext
1002.filename.ext
etc
 
The bbpress system in ImpEx doesn't do attachments. If you want to import attachments then you need to do some custom development for ImpEx.

That's what we figured. The two systems are very dissimilar in how they are storing attachments. I think this would have been built into Impex if attachments weren't a plugin for bbPress.

Fixing the quotes and stray extended characters won't be so difficult--more of an advanced search/replace operation on the posts table once we get everything over to XF.
 
That's what we figured. The two systems are very dissimilar in how they are storing attachments. I think this would have been built into Impex if attachments weren't a plugin for bbPress.

ImpEx is basically a two sided API which supports the output of attachments, so all that is needed is the getting them in.
 
Question, then--what does the API need from the bbPress side? If we can extract the original filename of the attachment and post ID that the files are attached to, is that all we would need? The Impex files confused me quite a bit, however, mainly due to the coding style and file/code dependencies--it takes me awhile to get used to another developer's style of coding, much like vB, Wordpress, and other scripts are coded in a specific style. I could probably take a stab at it once I figure out the internal workings of Impex.
 
Question, then--what does the API need from the bbPress side? If we can extract the original filename of the attachment and post ID that the files are attached to, is that all we would need?

Yes, you need a unique identifier for the attachment - where it's going (the target post id) - and it's data, or full path.

The Impex files confused me quite a bit, however, mainly due to the coding style and file/code dependencies--it takes me awhile to get used to another developer's style of coding, much like vB, Wordpress, and other scripts are coded in a specific style. I could probably take a stab at it once I figure out the internal workings of Impex.

That developer would be me.

I can't remember off the top of my head and don't have the code any more, though how many modules are there in the bbPress importer ?
 
Yes, you need a unique identifier for the attachment - where it's going (the target post id) - and it's data, or full path.

I am thinking we will need to put the attachments on the server also. (We're doing this on a separate dedicated server for now.) Maybe I can muddle through it and try to figure it out.

I can't remember off the top of my head and don't have the code any more, though how many modules are there in the bbPress importer ?

There are six:

001 Check and update database
002 Associate Users
003 Import user
004 Import forum
005 Import thread
006 Import post

We would need another module to do that, if I recall. I seem to remember SMF's Impex system had a separate attachment module.

Yes, I do remember you were the Impex expert over at The Other Place™. ;) I envy all the work you put into the system. Fortunately I never had to use it, although I did remember once asking if we could somehow save my old WebBBS forum. (I had a script at one point that could import WebBBS to phpBB2, so if I ever decide on it, I could go that route before importing another project over to XF.)
 
You'll need the attachments on the same server yes, if they are stored in the file system, if they are in the dB you can get away with it ....... though having everyone on one system is the way to go.

Personally I'd grab a file import module from another system and remake it into the 007 module and go from there linking up attachments and posts.
 
That is what I may attempt to do if I can muddle through it. Was there ever any API documentation for Impex? I still have a vB license for another forum I still administrate, so I can still access anything over there.
 
I'm way out of my league here, but let me run this by you guys...

The attachments that we want to bring over from bbPress, in my view, don't really need to be handled by Xenforo's attachment system. If attachments are inserted in posts like this:

[attachment=126158,1432]

... it would seem that the bbPress Attachments plugin author has made her own unique bbCode. If, as stated above, the numbers in the code are the post id and the attachment id, then couldn't there be a Xenforo plugin to handle the [attachment] bbCode? When that code is seen in a post, the information is grabbed from the database and a download link is dispayed for the attachment (also, if it's an image file, it's displayed at the end of the post).

This would eliminate the need to actually import the information through Impex. The attachments would still be on the server, Xenforo would display them, but they wouldn't be handled by Xenforo's attachment system... it would just be bbCode. Any new posts made in Xenforo would use Xenforo's regular attachment system, of course.

I'm making some assumptions here, so just tell me if this is a silly idea. :)
 
Top Bottom