Justman10000 Extension isn't updated for beta 16 yet, that'll come later

EDIT: looks like I updated it beginning february for beta 15 (which got support for beta 16 also) but i just forgot to tag it ... 🤦‍♂️

    2 months later

    Still incompatible because it is not compatible with the Alpha!

     - Installation request for michaelbelgium/mybb-to-flarum ^7.1 -> satisfiable by michaelbelgium/mybb-to-flarum[v7.1].
    - michaelbelgium/mybb-to-flarum v7.1 requires flarum/core ^0.1.0-beta.15 -> satisfiable by flarum/core[v0.1.0-

    beta.15, v0.1.0-beta.16] but these conflict with your requirements or minimum-stability.

      2 months later

      Jarry

      composer require Javier-Rotelli/mybb_to_flarum

      [InvalidArgumentException]
      Could not find a matching version of package Javier-Rotelli/mybb_to_flarum. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

      4 months later
      9 days later

      @MichaelBelgium

      Would it be possible to release this plugin as a newer version? The new version could also import from other forums such as phpBB, WoltLab or XenForo...

        Justman10000 This extension is only for MyBB, if it's needed to import from other forum software then there should be another extension for the according forum software
        It's possible it doesn't exist yet, but u can suggest it or make it yourself

          14 days later

          I'm getting Error 500's when trying to merge?

          Uncaught (in promise) r {status: 500, options: {}, xhr: XMLHttpRequest, responseText: null, response: null}
          Promise.then (async)
          (anonymous) @ admin.js?v=c8070b61:formatted:16470
          Promise.then (async)
          o.onsubmit @ admin.js?v=c8070b61:formatted:16457
          I.handleEvent @ admin.js?v=c8070b61:formatted:11365

          and

          POST https://wtstage.xxxx.com/api/mybb-to-flarum 500
          (anonymous) @ admin.js?v=c8070b61:formatted:11541
          (anonymous) @ admin.js?v=c8070b61:formatted:11449
          (anonymous) @ admin.js?v=c8070b61:formatted:11448
          e.request @ admin.js?v=c8070b61:formatted:4364
          (anonymous) @ admin.js?v=c8070b61:formatted:16458
          Promise.then (async)
          o.onsubmit @ admin.js?v=c8070b61:formatted:16457
          I.handleEvent @ admin.js?v=c8070b61:formatted:11365
          2 months later
          5 days later

          Hi,

          Thank you for the script ! It worked well (apart 2/3 things).

          I used this command : ./flarum migrate-data:from-mybb --host=127.0.0.1 --user=user--password='password' --db=mybb --path=/mybb/path/Upload

          I had theses logs :

          9 user groups migrated
          9653 users migrated
          24 categories migrated
          PHP Notice: Undefined offset: 0 in /flarum/vendor/s9e/text-formatter/src/Plugins/BBCodes/Parser.php on line 247
          4583 discussions migrated
          112824 posts migrated
          Migration successful

          But I have 2 problems :

          • First : Avatars are not imported (on web ui it works well but the script is crashing after 30 seconds so I use the command line)
          • Passwords are not working (it's not very a problem, I can ask users to change it but it's better if it works)

          Do you know what's not working ? Thanks !

          Fait i was on xenforo so went from Xenforo to mybb

          What's wrong with XF by the way? 😃
          Just curios.

            rdn XF is good but most of my users are Gen Z'ers and don't understand the traditional forum and I like where Flarum is going, I believe forums are going Flarum's direction!

            • rdn likes this.

            Version 8.1

            released yesterday

            Notable changes:

            • console command rewrite
            > php flarum migrate-data:from-mybb
            
            Description:
              Migrates data from an existing mybb forum
            
            Usage:
              migrate-data:from-mybb [options]
            
            Options:
                  --host=HOST            host of the mybb database
              -u, --user=USER            user of the mybb database
              -p, --password[=PASSWORD]  password for the mybb database [default: ""]
              -d, --db=DB                name of the mybb database
                  --prefix[=PREFIX]      prefix of the mybb database tables [default: "mybb_"]
                  --users                Import users (excluding avatars)
                  --threads-posts        Import posts (excluding soft deleted posts/threads)
                  --groups               Import groups
                  --categories           Import categories
                  --avatars              Import avatars
                  --path[=PATH]          Path to the mybb forum (used for avatar migration) [default: ""]
                  --soft-posts           Import soft deleted posts
                  --soft-threads         Import soft deleted threads
              -h, --help                 Display help for the given command. When no command is given display help for the list command
              -n, --no-interaction       Do not ask any interactive question

            Examples:
            Migrate only users and avatars

            > php flarum migrate-data:from-mybb --host=127.0.0.1 --user=homestead --password=secret --db=mybb --users --avatars --path=../mybb

            Migrate everything (excluding avatars and soft deleted posts/threads)

            php flarum migrate-data:from-mybb --host=127.0.0.1 --user=homestead --password=secret --db=mybb --users --groups --threads-posts

            Migrate users with threads and posts including soft deleted threads but excluding soft deleted posts

            php flarum migrate-data:from-mybb --host=127.0.0.1 --user=homestead --password=secret --db=mybb --users --threads-posts --soft-threads
            • avatar path fixes

            There's also a new release coming up, which gives support for attachments - only possible if you have fof/upload installed.

            a month later
            2 months later
            a month later

            Hi there ;D
            At first this extensions are very awesome ;D
            Now, I would make migration from my forum in flarum, but I have become this message
            https://paste.md-5.net/equkagafow.pl

            What make I wrong ?

            my forum run on the actual version 1.8.30

            greetings
            Gerriet

              Is maybe the plugins that problem?

                Bogus I can't be of detailed assistance here, but the from a quick look into the source it seems to have a connection with the user groups. Maybe some members with too many or no group that's causing the problem?

                                    foreach($userGroups as $group)
                                    {
                                        if($group <= 7) continue;
                                        $newUser->groups()->save(Group::find($group));
                                    }
                                }

                The error mysqli object is already closed means it cant connect to database, but i assume you fixed that as it only happened once.

                The user group error should be looked into: it's trying to add a user to a usergroup but that usergroup doesnt exist in the flarum database.

                • either the usergroup failed to migrate (but it exists in mybb db)

                • the usergroup doesn't exist in mybb database, which results in the same as above

                The easiest way to find out what group it tries to access is to debug in my Migrator.php file.
                but i forgot what function u can use to write to flarum.log - imma look it up (or someone might be quicker)

                5 days later

                HI there ;D
                If I leave the groups out, the convert should work or ?

                a month later

                Trying to migrate and I'm getting the 'Oops!' error and the following in the error log:

                [2022-08-18 11:28:22] flarum.ERROR: TypeError: Illuminate\Database\Eloquent\Relations\BelongsToMany::save(): Argument #1 ($model) must be of type Illuminate\Database\Eloquent\Model, null given, called in /home/hx9xvmlx8jo1/public_html/owd/discuss/vendor/michaelbelgium/mybb-to-flarum/src/Migrator.php on line 149 and defined in /home/hx9xvmlx8jo1/public_html/owd/discuss/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php:1147

                I'm curious why the passwords are set (seeded?) to time() during the migration? That seems pretty insecure. The time of migration can be found in the columns that are set to Carbon::now() in the same migration script, or it could be brute-forced pretty easily if you roughly know the week the migration took place on.

                If the goal is to set a random unguessable password, PHP has much better methods to generate those. Or even better, leave the column empty so it won't be a valid hash and no passwords will match.

                EDIT: after re-reading the code I realize the code might actually set the password to the bcrypt hash of the time, which stores a hash of a hash, so the hash that serves as password is in fact random since it contains the bcrypt salt which is a true random value. If that's the case then it's safe against attacks, but why do something so complicated to generate a random password? It's so slow compared to other options, there's no need to go through 10 rounds of bcrypt hashing if all you need is a random value.

                The script ends up doing 2 times 10 rounds of bcrypt for each user, all of that to set an unusable password? This will waste a lot of minutes over a large dataset migration.

                3 months later

                @MichaelBelgium I executed the migration but received the following error:

                SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

                I ran through each of users/posts/groups/categories individually and this time they all migrated. However, none of my discussions have been assigned their tags :-( there are about 4,000 so re-adding them manually would take a long time! Any ideas?

                  Never mind - I figured out a workaround by exporting/importing the values via a csv file

                  MikeBanim SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

                  Doesn't that mean that your mysql server isn't running or wrong user/password?

                  @clarkwinkelmann The password is just a bcrypt of current time. I'm not sure where you see it's doing it multiple times?

                  Or even better, leave the column empty so it won't be a valid hash and no passwords will match.

                  Password field is required (at least at the time of making the extension) so not sure what to put instead tho?

                    MichaelBelgium bcrypt does multiple rounds of hashing on a value to generate the output. The more rounds, the more secure the hash is, but the more processing power and time it takes (which is the whole point to protect against brute-force). By default PHP does 10 rounds if you don't specify it. If you create a bcrypt hash and then set it as password through Flarum method it's hashed again, so that would be 20 rounds total.

                    If you are only trying to generate invalid values, that's a lot of processing time wasted when an empty password column or value generated from the system random generator would serve the same purpose. You won't notice much on hundreds of records but on millions of records it can be significant if the server isn't very powerful.

                    In Laravel seeds and Flarum tests, password hashes to use are pre-generated and stored in constants to make execution faster. My own Flarum migration script has a bcrypt cache implemented to speed up subsequent re-reruns because of how long it adds to the total execution time. Hence why I would recommend to not use bcrypt at all if the goal can be achieved in a more performant way.

                    If you create the database model manually, you can set the raw value of the password column to an empty string or just random content. It won't be a valid bcrypt hash, so it'll never match any input.

                      6 days later

                      MichaelBelgium it was about 50000 records through the posts migration when I received that error. However it worked fine the second time I executed it 🤷‍♂️

                      clarkwinkelmann Ah alright i see! I didn't know User::register() hashes the password, I didn't see it in the source code.

                      Either way you're right, it's time wasted for the same, invalid values, purpose. I've updated the extension

                      7 months later

                      Hi there ;D
                      I have now test my little forum zu merge from mybb to flarum. So I have issues in the log and here is the log ;D
                      https://paste.md-5.net/iqokujahac.shell

                      I have no idea, what is the fall by me or better in my forum. I hop you can me help me ;D

                      Greetings

                      Gerriet

                      22 days later

                      itsjp89 Neither

                      Whats there to update? It's not being updated as long as its compatible with newest flarum + if mybb doesn't change their database structure

                      But yeah, like @luceos said you could try it out, I didnt receive any bug reports since months/years so I assume it still works