4 months later

Hi! I'm the guy that has been posting issues and PRs in github 😃 just passing by.

I have a big mybb forum (40k users, 2k active lurkers/day, 900k posts) I'm looking forward to migrate into Flarum (well, at least evaluate it as an option).
so expect me to be asking questions here and there

thanks for your great work!

2 months later

Hi, will this extension work on the latest MyBB 1.8 ? Thanks.

6 days later

@MichaelBelgium

Hey, thanks for creating this extension. I used it on one of my forums a few weeks ago and it worked perfectly.

But I'm trying to move another MyBB forum to Flarum and your extension isn't working. It says

Oops! Something went wrong. Please reload the page and try again.

I checked the log folder /storage/logs and it's empty. JavaScript console shows:

request.js:173 POST https://forums.MYSITE.com/api/mybb-to-flarum 500
(anonymous) @ request.js:173
(anonymous) @ request.js:23
(anonymous) @ request.js:22
e.request @ Application.js:352
(anonymous) @ MybbToFlarumPage.js:166
Promise.then (async)
o.onsubmit @ MybbToFlarumPage.js:165
I.handleEvent @ render.js:888
admin#/mybb-to-flarum:1 Uncaught (in promise) i {status: 500, options: {…}, xhr: XMLHttpRequest, responseText: null, response: null, …}
Promise.then (async)
(anonymous) @ MybbToFlarumPage.js:178
Promise.then (async)
o.onsubmit @ MybbToFlarumPage.js:165
I.handleEvent @ render.js:888

I narrowed it down to the migrate users option being the cause of the error. Unchecking migrate avatars has no effect.

These work either individually or altogether:

  • Migrate threads and posts
  • Migrate user groups
  • Migrate categories

I checked the usernames and saw that one of them was using an email address as a username so I renamed them and tried again. Same error.

I checked to see what kind of restrictions Flarum puts on usernames by registering a new account and found out that dots and spaces are not allowed.

The username may only contain letters, numbers, and dashes.

Using MySQL, I update the database of mybb_users and replaced all usernames containing spaces and dots to dashes.

Same error.

I deleted most of the user base and attempted to migrate it. Same error, but this time it did import some users. Again, no error log.

Deleting every user except my admin user also did not work, same error. MyBB doesn't seem to let me delete my own admin account.

Any help would be appreciated.

    Neuro The JS error doesn't say much, it'd be more helpful if u enable debug of your flarum instance. Then you get a log file in the myflarum/storage/logs folder. Then I could help more i bet!

      Neuro I checked the log folder /storage/logs and it's empty. JavaScript console shows:

      Very odd... Error logs should be added there regardless of debug mode.

      That being said, if you do enable debug mode and try sending the request, there'll be a "debug" button on the error message, which if you click, you should see more info about what's going wrong.

        11 days later

        Should I start my own thread about this issue? I'm still trying to migrate from MyBB to Flarum.

          Neuro since it seems to be an issue with this extension I think the discussion can continue here.

          Neuro Nothing in storage/logs either.

          Check the browser network tab while performing the request. null in the error modal can indicate the response wasn't valid JSON and failed parsing. The network tab will show the full actual response, which might include a PHP notice or warning in HTML format.

            clarkwinkelmann

            Nothing shows up in the response tab:

            This request has no response data available

            I modified the import script and made it assign the imported users' username and email to a counter variable and "test", so

            Username: Test1
            Email: Test1@test.com
            Username: Test2
            Email: Test2@test.com

            Even set the password to "test" just in case.

            It's the same error,

            It imports some users and then stops randomly. The number of users it imports seems to vary for some reason, like 400 +/- 5.

            Don't know what else to do.

            20 days later

            Is there no way to diagnose this problem? I tried modifying the script to log every user imported to the console but it doesn't seem to be working.

              Neuro by any chance, have you been able to narrow it down to some form of representative dataset? Something that might suggest what portion of the data is causing the issue?

              If not I'll try and take a look at the code in a bit more detail tomorrow.

                askvortsov Well, it's not

                • Threads and posts
                • User groups
                • Categories
                • Username
                • Email

                Not sure what else could be at fault here. I don't know how to find out either.

                A 500 can be generated either by Flarum, PHP or the webserver. Inspect the response headers of the request to see which one is to blame. Then look at server logs to find an error.

                And in case you have a config.php make sure to enable debug by changing it to true instead of false.

                  luceos Sorry, I'm not really sure how to interpret this. I've copied and pasted the entire response. I changed the url and server IP address. If there's any sensitive information in it please let me know or kindly remove it yourself.

                  I'm guessing it's an issue with the server, nginx? I checked the access log and it does not mention any errors.

                  As far as I know, I don't have a config.php file. The Flarum instance is new.

                  General
                  Request URL: https://forums.mysite.com/api/mybb-to-flarum
                  Request Method: POST
                  Status Code: 500 
                  Remote Address: [myserver]:443
                  Referrer Policy: no-referrer-when-downgrade
                  
                  Response headers
                  content-type: text/html; charset=UTF-8
                  date: Sun, 14 Mar 2021 02:27:39 GMT
                  server: nginx/1.14.0 (Ubuntu)
                  strict-transport-security: max-age=15768000
                  
                  Request headers
                  :authority: forums.mysite.com
                  :method: POST
                  :path: /api/mybb-to-flarum
                  :scheme: https
                  accept: */*
                  accept-encoding: gzip, deflate, br
                  accept-language: en-US,en;q=0.9
                  cache-control: no-cache
                  content-length: 127
                  content-type: application/json; charset=UTF-8
                  cookie: _csrf=gkX_4Cq386rD-wPXWOSRt0VF; _ga=GA1.2.2023641700.1612589209; __profilin=p%3Dt%2Ca%3Dc4c2c3c0a8d3ba502a8731b43d474951; _forum_session=UVZmcFgrVkhHNTlHVmVCY1BsNEdEdUdycHd4OWExckVCMlJSM21PUERibXYzcFArSG1ybmxrZEhFcUFCUmVMV0RudlJNWUhERlFxbU05T2VJOXIrT0pNaTNIWEdTTDNnWFlJYkR6RVBnQ0lZVEdPVU1MdjhISDlRZkI1eUhuRDVxajgzUmNralpQTEk4N3ZibWxraXNmNVhXU29oQWtaMlc2Z1NENWRWVXkvRjdDZ2tNaHpQaWZrcTBtakszR2NoZmZoaWFqWHYrQWtYMUhsdEJNc2dQcTZ0WnVsQzlzUWR5QVRManZPSWV6TTJRL3RLUEk2bTFQMTFYU0drcTg1NUtpMzQycjJOKzA5ekdnUHRGb3VSS3FVelpwUnludFNraFgrdDBsRGdsK0ZvbFV2LzRldktyT3k4OU1vVDI0cjBLaC9RRm5sbDZDU0NHMjNaSXBGdU5JM1FWTi9KZEN4d0ZPM3hDbUY1eVBzcTBpYW0wYjRpcGRUUTFhMnY2UVdzb3RzWWlOUFY3Y1Z2c1MwNjRQcVZWaVJ6Yms2RGswRkpnZVhDcnZ3a1QvSUs1djVrb1VBemFMbk5jMFBiNGR5dGVqb01SSGlQaUNaWkFCZGxYcG5EY2c9PS0tc0hCeXpjenZqMVhOYnI1WEdVci9Ddz09--a0664c979af0b408037c71ca5fd79e25cc45c456; _t=2cd0a31f0d551065cfdc251870b05627; io=8zbz4F-BDXy7RBYsAAAE; flarum_remember=sLGk1fPKmoCywV8b2BQaW9ZO6h6eYgiXaoEyo5D1; flarum_session=PMvFdhAUZTPm50bsqzbKAFDXIjgIXt12NWHnoPem
                  dnt: 1
                  origin: https://forums.mysite.com
                  pragma: no-cache
                  referer: https://forums.mysite.com/admin
                  sec-fetch-dest: empty
                  sec-fetch-mode: cors
                  sec-fetch-site: same-origin
                  sec-gpc: 1
                  user-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/IP_ADDRESS_ Safari/537.36
                  x-csrf-token: ZYmuqDclwdjUagaWzNwdXpZX3CrX4EsvtU2wT1jw
                  
                  Request payload
                  {avatars: true, softposts: false, softthreads: false, doUsers: true, doThreadsPosts: true,…}
                  avatars: true
                  doCategories: true
                  doGroups: true
                  doThreadsPosts: true
                  doUsers: true
                  softposts: false
                  softthreads: false

                    Neuro server: nginx/1.14.0 (Ubuntu)

                    This means the webserver found an error, not php. Make sure to check the nginx error log.

                    The most common error is that there are users with the same emailaddress in mybb, flarum does'nt except that. Should be unique, u could check that in ur mybb data @Neuro

                    Either way its annoying u dont have any logs..

                      MichaelBelgium Thanks, this fixed the issue. 🙂

                      In the past I tried deleting all users and importing just my own user and even then it did not work. Not sure why it worked this time.

                      I saw a bunch of users using the same gmail email address but with dots in them. So t.est@gmail.com, te.st@gmail.com, etc. Deleting them seems to have fixed it.

                      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 ... 🤦‍♂️