Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
phpBB2 attachment support for ImpEx Details »»
phpBB2 attachment support for ImpEx
Version: 1.00, by OmerE OmerE is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 07-24-2004 Last Update: Never Installs: 9
Is in Beta Stage  
No support by the author.

Hi,

This "mod" will import attachments from your phpBB2 board to
your vB3 board, and comes in the form of another ImpEx module for
the phpBB2 system.

You must patch your impex before you start the import process.
You cannot use this to import attachments from a phpBB2 board
to an existing vBulletin board already imported, as crucial data is
missing (namely, mapping the old phpBB2 postid to the new vB postid).

It also requires a small modification to one of the core ImpEx files
to fix a small bug (missing addslashes on a variable passed to the DB),
and several other phpBB2 module files.

I wrote this for personal use, in order to import my own board.
Later tested it on another board and fixed a few bugs, but I'm certain
there may be some left.

It's based on the IPB attachment importer, but I believe I'm allowed
to post it here, as only registered owners should be able to grab the
code.

Two small comments - during the import stage, it will ask you what's
the largest attachment you want to import. This is limited by several
factors - the setting of the MySQL variable "max_allowed_packet" (as
attachments are imported into the DB), and the type of the filedata
field in the attachment table. vB uses "mediumtext", which will
limit you to 16MB attachments. If you want to import larger attachments,
be sure to change these two. If using the slow queries log, you may
also want to consider either disabling it temporarily, or raising the
long_query_time value - otherwise the MySQL will choke itself just
trying to write out almost every single large attachment to the logfile...
which will slow things down even more.

Finally - in order for the import process to finish quickly and efficiently,
an INDEX is required on the importpostid column in the "post" table.
I did not add this automatically, as I'm not sure where all those added
fields that the importer adds to tables are cleared up. Before running
the attachments module (but after running the posts module), execute
this query:
Code:
ALTER TABLE `post` ADD INDEX `importpostidx` ( `importpostid` )
This will greatly speed up the process (running without it would
be much, much slower - try to avoid doing that).

I dunno if I'm allowed to post the modified ImpEx files themselves,
so I'll post a patch file from ImpEx 1.21 (much easier than listing by hand ).
If the files can be posted, please let me know, and I'll attach those as well.

To use the patch file put it one level above the "impex" directory,
then run:
patch -p1 -d impex < phpBB2_attachments_import.patch

EDIT: forgot to include the importattachmentid column here.
Look 2 posts down for instructions.


Hope this helps someone.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-25-2004, 03:47 PM
rookie7 rookie7 is offline
 
Join Date: Apr 2004
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is awsome. Been wanting to move my phpBB attachments. Now I finally can. Will surely give this a try.

Thanks for sharing.

*install*
Reply With Quote
  #3  
Old 08-08-2004, 09:57 PM
OmerE OmerE is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the patch file included here I neglected to add one required line
which is required in order to create a temporary column in the attachment
table during the upgrade process.

In impex/systems/phpBB2/001.php, around line 89, and AFTER you
use the patch file, find this:
Code:
                                '13'    => array('post'                 =>  'importpostid')
Replace with:
Code:
                                '13'    => array('post'                 =>  'importpostid'),
                                '14'    => array('attachment'                 =>  'importattachmentid')
If you're in the middle of the process, just add a BIGINT colum
named 'importattachmentid' to the attachment table.
Reply With Quote
  #4  
Old 08-13-2004, 07:13 AM
patj patj is offline
 
Join Date: Aug 2004
Location: Fresno, CA
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you clarify on what you mean by adding a BIGINT column to the attachment table? I have a phpBB import already underway and successful. I've patched my impex with both sets of changes but the attachment option does not show up in ImpEx.

Thanks in advance.
-Pat
Reply With Quote
  #5  
Old 08-13-2004, 08:39 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll forward this over to Jerry to confirm this is allowed Also he may have some use for it.
Reply With Quote
  #6  
Old 08-13-2004, 03:05 PM
patj patj is offline
 
Join Date: Aug 2004
Location: Fresno, CA
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool. To recap - I've already done an import of my users/messages and that worked OK. I ran patch, and replaced the missing line. When I fire up ImpEx from the ACP, no option shows up to import phpBB attachments. I'm wondering if I have to bump a file to tell it to restart the import.. or whether I need to extend the SQL schema with a new column as indicated above.

Your help is appreciated. Have a nice weekend.
-Pat
Reply With Quote
  #7  
Old 08-16-2004, 01:04 PM
cecilBergwin cecilBergwin is offline
 
Join Date: Aug 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

Ive currently installed a fresh vB3 and imported all my data from my old phpbb forums. My problems is now to import the attachments as its the only thing left for me to do.

Ive downloaded the "Attachment Fix" script but im a little miffed on where or what todo with this. Could somebody point me in the right direction as i would dearly like to import all my attachments and everything upto now has gone really well.

From a Board already up with only attachments waiting todo, what will i have todo in order to execute this script and import my phpbb attachments.

Any help greatly appreciated folks, ill be eyes open Thx.
Reply With Quote
  #8  
Old 08-17-2004, 12:16 PM
audigy audigy is offline
 
Join Date: Jun 2004
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'll help ya out...where are you stuck? After you did the mod there should be a module that says Import Attachments in ImpEx UNLESS you added this mod AFTER you started the inital import.
Reply With Quote
  #9  
Old 08-17-2004, 01:29 PM
cecilBergwin cecilBergwin is offline
 
Join Date: Aug 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thx Audigy mate,

Well im not sure ive added the module, above in instructions it says

To use the patch file put it one level above the "impex" directory,
then run:
patch -p1 -d impex < phpBB2_attachments_import.patch

Ive placed that file in the correct location but then what ? its say run the patch -p1 -d impex < phpBB2_attachments_import.patch but im presuming this is from sever side ? as im not sure on how to execute this script at all.

Many thx aud, appreciate your reply/time.

Cecil
Reply With Quote
  #10  
Old 08-17-2004, 02:08 PM
OmerE OmerE is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As someone mentioned, the module will not show up if you only
added it after starting an import session, due to the datastore ImpExSession
(or whatever it's called,I forget) storing a serialized version of the current
import state (one would hope that sometime in the future it would actually
store errors as well, kind of useless right now).

Regardless, the attachment import requires that the posts import module
adds another field to the table, so even if it did show you'd need to import
everything all over again.

As to how to use this: since I did not want to give step by step
instructions on how to patch the ImpEx files, I included a patch file.

If you do not have command line access to the machine your vB3 is running
on, you'll have to unpack impex locally, patch it, then transfer things over
to the server. If using Windows, grab the patch utility here:
http://prdownloads.sourceforge.net/g...n.exe?download

Or simply install Cygwin.

Hope this helps.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:57 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04544 seconds
  • Memory Usage 2,297KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete