Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
phpBB2 attachment support for ImpEx Details »
phpBB2 attachment support for ImpEx
Mod Version: 1.00, by OmerE (Member) OmerE is offline
Developer Last Online: Sep 2019 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 9
Released: 25 Jul 2004 Last Update: Never Downloads: 7
Not Supported Is in Beta Stage  

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 26 Sep 2004, 20:03
Paul R's Avatar
Paul R Paul R is offline
 
Join Date: Sep 2004
Hi OmerE,

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

Here is the lines from the rej file.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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
  #17  
Old 30 Sep 2004, 11:28
OmerE OmerE is offline
 
Join Date: Jan 2004
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
  #18  
Old 04 Oct 2004, 14:40
Jerry's Avatar
Jerry Jerry is offline
 
Join Date: Jun 2003
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.
__________________
All the ImpEx are belong to us.
Reply With Quote
  #19  
Old 13 Oct 2004, 23:34
tide tide is offline
 
Join Date: Oct 2004
Thanks so much for this patch. If not I would have had to write it myself. Good work!
Reply With Quote
  #20  
Old 30 Oct 2004, 21:30
mels mels is offline
 
Join Date: Oct 2004
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
***************
*** 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
***************
*** 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:

Last edited by mels; 30 Oct 2004 at 22:21.
Reply With Quote
  #21  
Old 01 Nov 2004, 14:57
OmerE OmerE is offline
 
Join Date: Jan 2004
I've received information about the issue from Melanie (off-board), and it
seems that the current ImpEx is compatible with the patch, but not with
the patch file. I'll post a new patch file as soon as I have some time.

Omer.
Reply With Quote
  #22  
Old 23 Nov 2004, 07:39
zigx zigx is offline
 
Join Date: Feb 2004
Originally Posted by OmerE
I've received information about the issue from Melanie (off-board), and it
seems that the current ImpEx is compatible with the patch, but not with
the patch file. I'll post a new patch file as soon as I have some time.

Omer.
is this updated already?
Reply With Quote
  #23  
Old 23 Nov 2004, 08:15
zigx zigx is offline
 
Join Date: Feb 2004
Hey guys, im getting this error:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any ideas?

Last edited by zigx; 23 Nov 2004 at 08:17.
Reply With Quote
  #24  
Old 23 Nov 2004, 08:21
zigx zigx is offline
 
Join Date: Feb 2004
for some reason that function and the one under it were in there twice..just deleted an instance of both of htem and that fixed it.
Reply With Quote
  #25  
Old 24 Nov 2004, 02:11
zigx zigx is offline
 
Join Date: Feb 2004
Unhappy

hi OmerE, check the attachment i put on thispost...


i imported everything fine until i got to the attachment module.... hit attachment, then the error below popped up and my browser memory usage started to SKY rocket until the computer froze...

Now when i try to go back into impex's importer area it gets stuck in a loop and trys to load the frame for infinity... not sure what to do.

i couldnt get more details than this Screen shot when it crashed, but do you have any idea whats going on? or anyone for that matter?! thanks a lot guys.

and especailly thanks for this hack because if i can get it to work....i will consider you my life saver lol.
Attached Images
File Type: jpg attach_fail.JPG (84.7 KB, 7 views)

Last edited by zigx; 24 Nov 2004 at 03:04. Reason: forgot important data
Reply With Quote
  #26  
Old 24 Nov 2004, 03:45
zigx zigx is offline
 
Join Date: Feb 2004
Originally Posted by OmerE
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you're in the middle of the process, just add a BIGINT colum
named 'importattachmentid' to the attachment table.
also, my 001.php didnt have that line in it... but i added the BIGINT column to the end of the table.
Reply With Quote
  #27  
Old 24 Nov 2004, 10:12
Jerry's Avatar
Jerry Jerry is offline
 
Join Date: Jun 2003
If you PM me over at vbulletin.com I will add this offically so you don't have to mess about with hacks.........
__________________
All the ImpEx are belong to us.
Reply With Quote
  #28  
Old 24 Nov 2004, 10:13
Jerry's Avatar
Jerry Jerry is offline
 
Join Date: Jun 2003
Originally Posted by zigx
also, my 001.php didnt have that line in it... but i added the BIGINT column to the end of the table.
It wouldn't all that has changed now.
__________________
All the ImpEx are belong to us.
Reply With Quote
  #29  
Old 24 Nov 2004, 12:26
zigx zigx is offline
 
Join Date: Feb 2004
wow im BRAND new to vB so this is all new to me... ill drop u a PM.
Reply With Quote
  #30  
Old 24 Nov 2004, 12:31
Jerry's Avatar
Jerry Jerry is offline
 
Join Date: Jun 2003
Originally Posted by zigx
wow im BRAND new to vB so this is all new to me... ill drop u a PM.
Well I'm one of the developers and have been after a board with attachments for a while so I can add the attachment module.
__________________
All the ImpEx are belong to us.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 07:04.

Layout Options | Width: Wide Color: