vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - ImpEx Module: Xenforo (https://vborg.vbsupport.ru/showthread.php?t=283111)

iBaker 06-13-2012 07:30 AM

I am just about to run a test instance however the first thing that is displayed in impex before I even start importing is:
Code:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at [path]/impex/ImpExFunction.php:522) in [path]/includes/facebook/facebook.php on line 37

iBaker 06-13-2012 09:27 AM

I have finished a test run...very test only run to see what problems come up.

1. Firstly there is the error message across the top of the impex page that I posted about just above
2. As far as tables go, it reported 2 tables not found:
xf_identity_service NOT found.
xf_user_identity NOT found.
3. The Attachments path I just could not get right. I tried echoing the path and it showed the correct web address for the internal_data/attachments of the source web site but it failed on all attachments. I copied the source attachments folder to a folder in the target domain (i.e. vb site) and used the path /home/xxx/public_html/source_att/attachments/ and that worked for about 500 attachments out of 14,500

NOTES:
I am using XF v1.1.2 and vb v4.2 PL1
I run a dedicated server using WHM/cPanel and both domains (source and target) are on the same server
My XF site has 7,000 users, 25,000 Threads and 180,000 Posts

Andreas, if you want to test it all with access to the source and target domains let me know

big dan 07-05-2012 06:34 PM

Thanks for the great addon Andreas!

I'm seeing a problem running the import forums module.

The last forum errors out with

Code:

ImpEx Database error

mysql error: Invalid SQL:
                                        UPDATE forum
                                        SET parentid = 366
                                        WHERE forumid = 369
                               

mysql error: Table 'xxxxx_vbulldev.forum' doesn't exist

mysql error number: 1146

Date: Thursday 05th 2012f July 2012 03:31:07 PM
Database: xxxxxx_vbulldev
MySQL error:


Sadikb 07-24-2012 09:17 PM

If importing in a new VB instance, does this retain the same IDs (thread_id, forum_id etc) as the ones used in XF or not?

ragtek 07-27-2012 06:54 PM

"bug" in 000.php

PHP Code:

function parent_id_update($Source_Db_object$Target_Db_object$Source_tableprefix$Target_tableprefix)
    {
        
// mapping table: importforumid => forumid
        
$importforums = array();
        
        
$forums $Target_Db_object->query("
            SELECT forumid, importforumid, importcategoryid
            FROM 
{$Target_tableprefix}forum
            WHERE importforumid != 0 OR importcategoryid != 0
        "
);
        while (
$forum $Target_Db_object->fetch_array($forums))
        {
            if (
$forum['importcategoryid'] > 0)
            {
                
$importforums[$forum['importcategoryid']] = $forum['forumid'];
            }
            else
            {
                
$importforums[$forum['importforumid']] = $forum['forumid'];
            }
        
            
$forumcache[$forum['forumid']] = $forum;
        }
        
        
// mapping table: nodeid -> parentnodeid
        
$parentnodes = array();
        
        
$nodes $Source_Db_object->query("
            SELECT node_id, parent_node_id
            FROM 
{$Source_tableprefix}node
        "
);
        while (
$node $Source_Db_object->fetch_array($nodes))
        {
            
$parentnodes[$node['node_id']] = $node['parent_node_id'];
        }
        
        foreach (
$forumcache AS $forumid => $forum)
        {
            if (
$forum['importcategoryid'] > 0)
            {
                
$importid $forum['importcategoryid'];
            }
            else
            {
                
$importid $forum['importforumid'];
            }
            
            if (isset(
$parentnodes[$importid]) AND isset($importforums[$parentnodes[$importid]]))
            {
                
$Target_Db_object->query("
                    UPDATE 
{$tableprefix}forum
                    SET parentid = " 
$importforums[$parentnodes[$importid]] . "
                    WHERE forumid = 
$forumid
                "
);
            }
        }
    } 

should be
PHP Code:

function parent_id_update($Source_Db_object$Target_Db_object$Source_tableprefix$Target_tableprefix)
    {
        
// mapping table: importforumid => forumid
        
$importforums = array();
        
        
$forums $Target_Db_object->query("
            SELECT forumid, importforumid, importcategoryid
            FROM 
{$Target_tableprefix}forum
            WHERE importforumid != 0 OR importcategoryid != 0
        "
);
        while (
$forum $Target_Db_object->fetch_array($forums))
        {
            if (
$forum['importcategoryid'] > 0)
            {
                
$importforums[$forum['importcategoryid']] = $forum['forumid'];
            }
            else
            {
                
$importforums[$forum['importforumid']] = $forum['forumid'];
            }
        
            
$forumcache[$forum['forumid']] = $forum;
        }
        
        
// mapping table: nodeid -> parentnodeid
        
$parentnodes = array();
        
        
$nodes $Source_Db_object->query("
            SELECT node_id, parent_node_id
            FROM 
{$Source_tableprefix}node
        "
);
        while (
$node $Source_Db_object->fetch_array($nodes))
        {
            
$parentnodes[$node['node_id']] = $node['parent_node_id'];
        }
        
        foreach (
$forumcache AS $forumid => $forum)
        {
            if (
$forum['importcategoryid'] > 0)
            {
                
$importid $forum['importcategoryid'];
            }
            else
            {
                
$importid $forum['importforumid'];
            }
            
            if (isset(
$parentnodes[$importid]) AND isset($importforums[$parentnodes[$importid]]))
            {
                
$Target_Db_object->query("
                    UPDATE 
{$Target_tableprefix}forum
                    SET parentid = " 
$importforums[$parentnodes[$importid]] . "
                    WHERE forumid = 
$forumid
                "
);
            }
        }
    } 

the last prefix is wrong

Paul M 07-27-2012 09:04 PM

I cannot see any difference between the two bits of code, you probably want to make it more obvious.

big dan 07-27-2012 09:11 PM

Thanks Ragtek! That fixed my forums import issue. :up:

ragtek 07-28-2012 06:52 AM

Quote:

Originally Posted by Paul M (Post 2351984)
I cannot see any difference between the two bits of code, you probably want to make it more obvious.

Quote:

the last prefix is wrong
PHP Code:

 if (isset($parentnodes[$importid]) AND isset($importforums[$parentnodes[$importid]]))
            {
                
$Target_Db_object->query("
                    UPDATE 
{$tableprefix}forum
                    SET parentid = " 
$importforums[$parentnodes[$importid]] . "
                    WHERE forumid = 
$forumid
                "
);
            } 

vs

PHP Code:

if (isset($parentnodes[$importid]) AND isset($importforums[$parentnodes[$importid]]))
            {
                
$Target_Db_object->query("
                    UPDATE 
{$Target_tableprefix}forum
                    SET parentid = " 
$importforums[$parentnodes[$importid]] . "
                    WHERE forumid = 
$forumid
                "
);
            } 


merk_aus 08-01-2012 12:04 AM

So what is the best way to get passwords to work?

big dan 08-10-2012 01:03 AM

Quote:

Originally Posted by merk_aus (Post 2353195)
So what is the best way to get passwords to work?

After importing email your members with the password reset link. That's what I did. It wasn't too bad.


All times are GMT. The time now is 06:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01247 seconds
  • Memory Usage 1,800KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete