Jump to the post that solved this thread.
Solved: 2 Months, 4 Weeks, 2 Days ago Merge from phpbb3 to mybb
#1
Solved: 2 Months, 4 Weeks, 2 Days ago
So i want to convert my phpbb3 board  located in /forum directory ) to the mybb

Things i've done so far : installed mybb 1.8 in a mybb folder on the FTP and proceed a clean install
Created a copy of the database already present on my phpbb3 forum
created a copy of the database for mybb board
uploaded the merge folder inside the mybb board

I've tried to access the merge system https://legendcs.ro/mybb/merge but i receive a error message simillar to this reported here : https://community.mybb.com/thread-236936...pid1394682


From the dev advise i have downloaded the merge system from here : https://github.com/mybb/merge-system/arc...eature.zip

now when i try to access the merge system altough is very , very buggy it kinda works until one step .

It seems that he managed to import database/usergroups but it got stuck when it has to import users  there are 116 users )

   
   
   

Here is the documentation i have used to get here :


https://community.mybb.com/thread-238106.html
https://docs.mybb.com/1.8/merge/running/
https://mybb.com/download/merge-system/
https://docs.mybb.com/1.8/merge/running/
https://community.mybb.com/thread-236936...pid1394682
https://www.namecheap.com/support/knowle...hpmyadmin/


My question is what am i doing now ? the process sems to get stuck and i can start another process  until this is done for users
Reply
#2
Solved: 2 Months, 4 Weeks, 2 Days ago
which PHP-version do you use to merge?

it will only run with PHP <8
support ended 
Reply
#3
Solved: 2 Months, 4 Weeks, 2 Days ago
PHP Version 8.1.29 ... oh ok

At least it is a development in progress for the merge system for php 8 onwards ?
Reply
#4
Solved: 2 Months, 4 Weeks, 2 Days ago
a far as I know, the team is currently concentrating on MyBB 1.9
support ended 
Reply
#5
Solved: 2 Months, 4 Weeks, 2 Days ago
I have pushed some updated to the Merge System regarding the main system and the vBulletin 4 modules.

Please drop me a DM over Discord if you want to share your database for me to test your environment.

Regards.
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#6
Solved: 2 Months, 4 Weeks, 2 Days ago
Hi i managed to convert the forum after all.
Here is how you can do it 
Go to the  
 public_html/merge/boards/phpbb3/bbcode_parser.php

and replace the code you have inside
bbcode_parser.php
with this : 

<?php
/**
 * MyBB 1.8 Merge System
 * Copyright 2014 MyBB Group, All Rights Reserved
 *
 * Website: http://www.mybb.com
 * License: http://www.mybb.com/download/merge-system/license/
 */

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

class BBCode_Parser extends BBCode_Parser_Plain {

    // This contains the attachment bbcode which is handled as special code as the id needs to be changed too
    var $attachment = "\[attachment=([0-9]+)\].*?\[/attachment\]";
    // Cache for attachment codes (pid and counter)
    var $pid;

    /**
     * Converts messages containing phpBB code to MyBB BBcode
     *
     * @param string $text the text to convert
     * @param int $uid user id of the text
     * @param int $pid
     * @return string the converted text
     */
    function convert($text, $uid=0, $pid=0)
    {
        $text = utf8_unhtmlentities($text);

        if(!empty($uid))
        {
            $text = str_replace(":{$uid}", '', $text);
        }

        $text = str_replace(array('[/*:m]', '[/list:o]', '[/list:u]'), array('', '[/list]', '[/list]'), $text);

        // Smilies are saved as img code, with comments before and after. Remove that stuff.
        $text = preg_replace("#<!-- s(.*?) --><img src=\"{SMILIES_PATH}(.*?)\" alt=\"(.*?)\" (.*?) /><!-- s(.*?) -->#i", "$1", $text);

        // Reset attachment counter
        $this->pid = $pid;

        return parent::convert($text);
    }

    function convert_title($text)
    {
        $text = utf8_unhtmlentities($text);

        return $text;
    }

    // Callback for attachment bbcodes
    function attachment_callback($matches)
    {
        // Sorry guys, without pid nothing to do
        if($this->pid == 0)
            return '';

        global $module;

        $options = array(
            "order_by"       => "attach_id",
            "limit"          => 1,
            "limit_start"    => $matches[1],
        );
        $query = $module->old_db->simple_select("attachments", "attach_id", "post_msg_id={$this->pid}", $options);
        $id = $module->old_db->fetch_field($query, "attach_id");
        $module->old_db->free_result($query);

        if($id > 0)
        {
            return "[attachment=o{$id}]";
        }
        else
        {
            // Invalid code, remove it
            return "[ATTACHMENT NOT FOUND]";
        }
    }
}

// Define the utf8_unhtmlentities function
function utf8_unhtmlentities($string) {
    // Decode hexadecimal and decimal numeric entities
    $string = preg_replace_callback(
        '~&#x([0-9a-f]+);~i',
        function($matches) {
            return mb_convert_encoding(pack('H*', $matches[1]), 'UTF-8', 'UTF-16BE');
        },
        $string
    );
    $string = preg_replace_callback(
        '~&#([0-9]+);~',
        function($matches) {
            return mb_convert_encoding(pack('n', $matches[1]), 'UTF-8', 'UTF-16BE');
        },
        $string
    );

    // Decode named entities (e.g., &amp;, &lt;, &gt;)
    return html_entity_decode($string, ENT_QUOTES | ENT_HTML5, 'UTF-8');
}
?>
Then go to the :  

public_html/merge/resources/functions.php

and replace this : 
{
	// Replace numeric entities
	$string = preg_replace_callback('~&#x([0-9a-f]+);~i', create_function('$matches', 'return unichr(hexdec($matches[1]));'), $string);
	$string = preg_replace_callback('~&#([0-9]+);~', create_function('$matches', 'return unichr($matches[1]);'), $string);

	// Replace literal entities
	$trans_tbl = get_html_translation_table(HTML_ENTITIES);
	$trans_tbl = array_flip($trans_tbl);

	return strtr($string, $trans_tbl);
}

with this 
{
    // Replace numeric entities
    $string = preg_replace_callback(
        '~&#x([0-9a-f]+);~i', 
        function($matches) {
            return unichr(hexdec($matches[1]));
        }, 
        $string
    );

    // Replace literal entities
    $string = preg_replace_callback(
        '~&#([0-9]+);~', 
        function($matches) {
            return unichr($matches[1]);
        }, 
        $string
    );

    // Replace literal entities
    $trans_tbl = get_html_translation_table(HTML_ENTITIES);
    $trans_tbl = array_flip($trans_tbl);

    return strtr($string, $trans_tbl);
}
And after that it should be able to import the users to and the rest of them 
You may encounter issues importing attachements and avatars from the old board mainly because of the permission set inside the files i think  it needs to be 7777 ) and also it may be blocked if you have .htaccess inside 

This is what i found to make it working for me , it is not something official i'm just share what made my board to work .
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)