Importing from phpBB3

import

(Gerhard Schlager) #105

like every other plugin…


#106

I’m getting the same error, everything has been updated and I manually changed the import template for the mariadb bug before building the container:

root@xx:/var/discourse# ./launcher enter import
root@xx-import:/var/www/discourse# import_phpbb3.sh
The phpBB3 import is starting…

loading existing groups…
loading existing users…
loading existing categories…
loading existing posts…
loading existing topics…

importing from phpBB 3.0.14

creating users
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:107:in _query': Table 'phpbb.phpbb_users' doesn't exist (Mysql2::Error) from /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:107:inblock in query’
from /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:106:in handle_interrupt' from /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:106:inquery’
from /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/patches/db/mysql2.rb:20:in query' from /var/www/discourse/script/import_scripts/phpbb3/database/database_base.rb:16:inquery’
from /var/www/discourse/script/import_scripts/phpbb3/database/database_base.rb:28:in count' from /var/www/discourse/script/import_scripts/phpbb3/database/database_3_0.rb:7:incount_users’
from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:58:in import_users' from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:28:inexecute’
from /var/www/discourse/script/import_scripts/base.rb:45:in perform' from /var/www/discourse/script/import_scripts/phpbb3/importer.rb:20:inperform’
from script/import_scripts/phpbb3.rb:31:in <module:PhpBB3>' from script/import_scripts/phpbb3.rb:12:inmodule:ImportScripts
from script/import_scripts/phpbb3.rb:11:in `'
root@applespot-import:/var/www/discourse#

sql dump was done from the phpbb admin interface.


(Gerhard Schlager) #107

I’m not sure why this is happening. The InnoDB engine is disabled because there are performance issues when used with Docker. It should use MyISAM as fallback when the specified engine doesn’t exist. And in all my tests that’s exactly what’s happening.

Can you send me a database dump (export only the structure, no data) from the phpBB admin interface? I’d like to compare it with mine. I’d really like to solve this issue.

Here’s a workaround: Try replacing ENGINE=InnoDB in your database dump with ENGINE=MyISAM and restart the import.

You’ll probably need to delete the file /var/discourse//shared/standalone/import/mysql/imported in order to recreate the database on next import.


#108

Replacing every ENGINE=InnoDB to ENGINE=MyISAM inside the dump did the trick for me! Thank you!


(Miguel Dominguez) #109

Just imported my phpbb3 install into a blank discourse install and am having an issue with missing user profiles. The weird thing is, profiles work just fine for some users, but not others. I get an “Oops! That page doesn’t exist or is private.” error. I’ve been looking at the user table in the postgresql db trying to find some correlation between users with missing profiles, but no avail. I’ve attached a few screen shots. Any suggestions?


EDIT:
Figured out why profiles broke. Background: I am migrating from a phpbb3 installation where everyone had a local account. We are going to use LDAP for authentication in discourse and want to ensure that each username matches what we have in Active Directory. I accomplished this by grabbing all user email addresses and made a bunch of LDAP queries to grab valid usernames. After the import, in an effort to ensure that we had correct AD usernames for everyone, I ran update commands on the postgresql db (users table). We had a few stragglers that didn’t use their company email when they signed up initially, so those profiles didn’t break. All records that were touched by my sql statements, regardless of whether or not the username actually changed, caused the user profile to break. Lesson learned.

Does anyone know of the correct way to mass update usernames?


(Gerhard Schlager) #110

I suggest updating the usernames in phpBB3 before the import.


(Gerhard Schlager) #111

I updated the initial post with a more detailed guide for the Docker based import and added lots of entries to the FAQ.

Please don’t hesitate to ask if something is still unclear or in need of a better explanation.


(B Iggy) #112

Hey Gerhard,

I am really lost since 5 hours now. Docker is new for me aswell as discourse as well as digitalocean.
Just wanted to try something new since phpbb don’t be compatible with php7 (yet).
But don’t worry I am not a complete newby. Just mysql is not my strength.

So everything worked till the mysql remote stuff / import script.
First I got all the time Access denied so I tried different solutions to fix it. Now I got till that part here:

But don’t know why… in my phpmyadmin the prefix is exactly like the console saying it is wrong :confused:

Would really appreciate any help :frowning:


(Gerhard Schlager) #113

Please check the table prefix in the settings.yml. It should be phpbb_ without the dot.
I guess I need to change the comment in the settings file. :wink:


(B Iggy) #114

Well I did this because I thought, ok, if the sql don’t give me the stuff I put it in the settings.yml :wink:
If I am doing it like you mentioned it is coming:

This is my settings.yml
host: localhost port: 3306 username: root password: schema: phpbb table_prefix: phpbb_
Thank you very much for helping me!!


(Gerhard Schlager) #115

Are you trying to connect to a remote database or did you put a database dump in the /var/discourse/shared/standalone/import/data/ directory? The database configuration you posted is for the internal database of the Docker container which needs a database dump for it to work.

You can find the correct table_prefix in phpBB’s Administration Control Panel. In the following screenshot the prefix is phpbb_ since all tables start with this. You can set the prefix to blank if the table names have no prefix.


(B Iggy) #116

I tried both but for now I trying the local dumb. I did what you show. Downloaded the gzip file. Renamed it to phpbb_mysql.sql and placed it in /var/discourse/shared/standalone/import/data/
So still if I try it I get the screenshot above.

Do I need to update anything after I moved the .sql file to the import/data container?
I am missing one stupid thing for sure, sorry :frowning:


(Gerhard Schlager) #117

Did you unpack the gzip file? What’s the output of the import script when you start it? It should look like this:

root@test-import:/var/www/discourse# import_phpbb3.sh
Loading database dump into MySQL…
The phpBB3 import is starting…

If it doesn’t try deleting the following file on the host:
/var/discourse/shared/standalone/import/mysql/imported

Afterwards try to start the import script one more time.


(B Iggy) #118

oooooh man… after 7 hours… this little command did it!! Thank you so much Gerhard.

(Ich wusste es war was blödes, aber darauf wäre ich nie gekommen :slight_smile: )


(James North) #119

Hi Guys,

Thanks so much for keeping this script up to date @gerhard.

I’m just having two consistent problems with importing from phpBB 3.1.9.

Anonymous/Suspended Users

What’s happening is that all of my users are being ‘suspended’ or are somehow considered ‘anonymous’.

Say a user is called ‘John’.

The discourse install ends up with ‘John’ and his correct email address but with no posts by that user.

It also creates ‘John1’ with the anonymous string email address, and it attributes all posts to ‘John1’ rather than ‘John’.

It seems simple, but I’ve spent ages trying to figure it out - any tips?

Text formatting

The second issue I’m having is that returns from phpBB3 are being converted to some kind of courier new left/right scrolling window in discourse.

So it looks like this:

Thanks again

James


(Jeff Atwood) #120

Looks like you have 4 spaces in front of text there.

4 spaces in front of text means a code block

<-- 4 spaces there

(James North) #121

Wonderful, thanks Jeff, I’ll run a query to remove them.

(Interestingly, clicking edit and then save edit removed them on the running site - thought that was pretty cool).

EDIT: looks like some are tabs …


(Gerhard Schlager) #122

That’s strange. Could it be that those posts by John look like they were posted by an anonymous user? Were the affected posts created by phpBB or did you import them from another forum software into your current phpBB3 forum?

Take a look at a post by John in the database:

SELECT poster_id, post_username
FROM phpbb_posts

post_username should be empty unless it was posted by an anonymous user.


(James North) #123

Great thinking @gerhard.

Yes it was translated from ‘esoTalk’ which allows spaces in the usernames.

I had gone through the users and posts tables to make ‘James North’ become ‘JamesNorth’ but it appears something is still missing. After doing that, it just makes all users suspended/anonymous and at least isn’t creating the duplicate users.

I’m guessing it’s exactly what you are suggesting - post_username in the phpbb_posts table. Might got check that out, do another export from phpbb3 and post back.

Thanks again guys - it’s all going to be worth it as Discourse looks powerful and visually stunning.


(James North) #124

Yep - that’s done it. Making sure that post_username is empty in the phpbb_posts table.

Cheers @gerhard!