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
  #12  
Old 08-17-2004, 02:53 PM
cecilBergwin cecilBergwin is offline
 
Join Date: Aug 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thx very much, ill be looking into this straight away.

Cheers gents.
Reply With Quote
  #13  
Old 08-18-2004, 01:03 AM
patj patj is offline
 
Join Date: Aug 2004
Location: Fresno, CA
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OmerE,

Kindly edit your original post, and include that it should be installed BEFORE importing your phpBB settings. This has left me in a bind, and I will sit without phpBB attachments for now as I already have 60 users online.

Thanks for contributing your efforts.

Pat
Reply With Quote
  #14  
Old 09-02-2004, 06:23 AM
touristz touristz is offline
 
Join Date: Aug 2004
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone please help me to patch the files? I don't have Linux, and I tried both GnuWin32 and Cygwin.

Using Cygwin I got this error...

patching file ImpExDatabase.php
patching file systems/phpBB2/000.php
Hunk #1 FAILED at 14.
1 out of 2 hunks FAILED -- saving rejects to file systems/phpBB2/000.php.rej
patching file systems/phpBB2/009.php
patching file systems/phpBB2/013.php
Reply With Quote
  #15  
Old 09-04-2004, 09:16 AM
OmerE OmerE is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by touristz
Can anyone please help me to patch the files? I don't have Linux, and I tried both GnuWin32 and Cygwin.

Using Cygwin I got this error...

patching file ImpExDatabase.php
patching file systems/phpBB2/000.php
Hunk #1 FAILED at 14.
1 out of 2 hunks FAILED -- saving rejects to file systems/phpBB2/000.php.rej
patching file systems/phpBB2/009.php
patching file systems/phpBB2/013.php
Are you using the latest ImpEx?
Post the rejects file (systems/phpBB2/000.php.rej), it will show
what lines caused it to abort patching.

Don't forget to enclose within code tags.

Omer.
Reply With Quote
  #16  
Old 09-06-2004, 02:02 PM
touristz touristz is offline
 
Join Date: Aug 2004
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the response. But I managed to patch the file manually using notepad. Took awhile for me to understand how the patch file works

Thanks again! It worked flawlessly!
Reply With Quote
  #17  
Old 09-26-2004, 06:03 PM
Paul R's Avatar
Paul R Paul R is offline
 
Join Date: Sep 2004
Location: UK
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi OmerE,

I got the same msg as touristz on my Linux box.

Here is the lines from the rej file.

Code:
***************
*** 14,20 ****
  *
  * @package 		ImpEx.phpBB2
  * @version		$Revision: 1.30 $
- * @author		Jerry Hutchings <jerry.hutchings@vbulletin.com>
  * @checkedout	$Name:  $
  * @date 		$Date: 2004/06/28 18:28:32 $
  * @copyright 	http://www.vbulletin.com/license.html
--- 14,21 ----
  *
  * @package 		ImpEx.phpBB2
  * @version		$Revision: 1.30 $
+ * @author		Jerry Hutchings <jerry.hutchings@vbulletin.com>, minor additions
+ *					by Omer Efraim <oefraim@gmail.com> to support attachments
  * @checkedout	$Name:  $
  * @date 		$Date: 2004/06/28 18:28:32 $
  * @copyright 	http://www.vbulletin.com/license.html
The rest of the file were patched sucessfully.

Thanks for taking the time to look at this. Would love to be able to get the attachments over from my old phpbb2 board

Paul
Reply With Quote
  #18  
Old 09-30-2004, 09:28 AM
OmerE OmerE is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul R
Hi OmerE,

I got the same msg as touristz on my Linux box.

Here is the lines from the rej file.

...

The rest of the file were patched sucessfully.

Thanks for taking the time to look at this. Would love to be able to get the attachments over from my old phpbb2 board

Paul
Hi,

Since patch should be patching the files hunk by hunk, it should be fine.
To be certain, take a look at 000.php - if you can find this text in it
"function get_phpbb2_attachment_details" - then all is well.

Omer.
Reply With Quote
  #19  
Old 10-04-2004, 12:40 PM
Jerry's Avatar
Jerry Jerry is offline
 
Join Date: Jun 2003
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If anyone would like to offer the board and attachments dir for dev I'll include an attachment module in the official importer, its just to date I've not got a phpBB site with the attachments, I've only ever got the mysqldump.

PM me over at vb.com.
Reply With Quote
  #20  
Old 10-13-2004, 09:34 PM
tide tide is offline
 
Join Date: Oct 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks so much for this patch. If not I would have had to write it myself. Good work!
Reply With Quote
  #21  
Old 10-30-2004, 07:30 PM
mels mels is offline
 
Join Date: Oct 2004
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello there,

So great to hear this excellent news. I went ahead and tried to import the attachments. We ran the patch and got a couple of errors which I'll show later in this post.
I do see the import attachments module in my impex list and I can run it. Except it says on each line "skipping"... and sometimes it does say "skipping, possible PM attachment" and then it shows the attacht ID but when the module is over and I'm redirected to my impex main page, it's says 0 imported, 0 failed. What am I doing wrong?
Also, here's the info from the patch :

From 009.php.rej
Quote:
***************
*** 116,122 ****
$start = time();

$post_object = new ImpExData($Db_target, $sessionobject, 'post');
-
foreach ($posts_array as $post_id => $post)
{
$try = $post_object;
--- 116,121 ----
$start = time();

$post_object = new ImpExData($Db_target, $sessionobject, 'post');
foreach ($posts_array as $post_id => $post)
{
$try = $post_object;
***************
*** 124,129 ****
$try->set_value('mandatory', 'userid', $users_ids["$post[poster_id]"]);
$try->set_value('mandatory', 'importthreadid', $post['topic_id']);

$try->set_value('nonmandatory', 'visible', '1');
$try->set_value('nonmandatory', 'dateline', $post['post_time']);
$try->set_value('nonmandatory', 'allowsmilie', $post['enable_smilies']);
--- 123,129 ----
$try->set_value('mandatory', 'userid', $users_ids["$post[poster_id]"]);
$try->set_value('mandatory', 'importthreadid', $post['topic_id']);

+ $try->set_value('nonmandatory', 'importpostid', $post_id);
$try->set_value('nonmandatory', 'visible', '1');
$try->set_value('nonmandatory', 'dateline', $post['post_time']);
$try->set_value('nonmandatory', 'allowsmilie', $post['enable_smilies']);
From 000.php.rej
Quote:
***************
*** 14,20 ****
*
* @package ImpEx.phpBB2
* @version $Revision: 1.30 $
- * @author Jerry Hutchings <jerry.hutchings@vbulletin.com>
* @checkedout $Name: $
* @date $Date: 2004/06/28 18:28:32 $
* @copyright http://www.vbulletin.com/license.html
--- 14,21 ----
*
* @package ImpEx.phpBB2
* @version $Revision: 1.30 $
+ * @author Jerry Hutchings <jerry.hutchings@vbulletin.com>, minor additions
+ * by Omer Efraim <oefraim@gmail.com> to support attachments
* @checkedout $Name: $
* @date $Date: 2004/06/28 18:28:32 $
* @copyright http://www.vbulletin.com/license.html
Thank you for your help!

Mels.


mmm... okay here's a little edit. Turns out my path was wrong Now I get another error message though... which is :

"Imported pm_text, Error with importing attachment"

On each and every line that is treated by the script... Can anyone help me on this one ?
1. Why this error?
2. Why only pms ?? Where are all my posts attachments ? :ermm:
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 10:15 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.05184 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_code
  • (4)bbcode_quote
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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