Importing from phpBB3


(Markus Heckmann) #173

I’m using a .sql dump that i have placed in the above mentioned folder, but when running the import script from inside the docker, it quits with the error:

Loading database dump into MySQL...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

are there any dependencies I have to install on the ubuntu server to get this to work? I understood from the howto that it would be using MariaDB, so MySQL is not needed?

Thank you very much

(Jay Pfaffman) #174

That’s true, but the error suggests that mariaDB isn’t running.

(Markus Heckmann) #175

Pardon my very superficial knowledge:
Do I need to install MariaDB or just start it?

(Jay Pfaffman) #176

I’ve not re-read the instructions, but I’m 99% sure that there’s something in the instructions about installing MariaDB. If you try to start it and it’s not there, you’ll need to install it.

(Markus Heckmann) #177

Unfortunately it only says that the container comes with MariaDB:

Anyhow - let’s see if I can figure that out…

(Jay Pfaffman) #178

I’ve been doing Discourse imports for people for over six months. No one has ever asked me to do a phpBB3 import. It could be that few people want to move from phpBB3 to Discourse, but it’s more likely because @gerhard’s importer and his instructions are so good. It’s a good bet you’ll figure it out. :slight_smile:

(Gerhard Schlager) #179

Let me test that real quick, but I don’t think that anything is broken…

In the meantime please make sure that you

  • added the phpbb3.template.yml (step 1.2)
  • are inside the import container (step 1.5) and not the app container

Edit: Everything seems to work fine. I just started an import…

@Markus_Heckmann What is the output of docker ps? It should look like this.

The import container should be running which contains a MariaDB instance.

(Markus Heckmann) #180

I did get it running with

sudo apt-get install mariadb-server

The output from docker ps shows:

6dfa393d7fd4 local_discourse/import “/sbin/boot” 22 hours ago Up About an hour>80/tcp,>443/tcp import


(Jay Pfaffman) #181

Hey, @gerhard. I’ve got an import that’s breaking because of duplicate category names and, surprisingly, it’s stopping rather than giving a warning.

validations.rb:79:in `raise_record_invalid': Validation failed: Category Name has already been taken (ActiveRecord

Should I try to check for a duplicate name in map_category (and maybe add a "2" after it, or put a rescue somewhere?

(Gerhard Schlager) #182

There’s already a check for duplicate categories within the same parent category. Maybe it stopped working?

(Jay Pfaffman) #183

Well, that seems bizarre, but I often see duplicate categories generate warnings, so your “stopped working” hypothesis seems viable. That particular bit of code appears to be a couple years old.

It looks like @zogstrip was the last person to change base.rb, but I don’t see anything in his commit having to do with categories.

Ah. Perhaps it’s no longer legal to have two categories with the same name, even if they are subcategories with different parents? I removed the if .... in line 407 and I’m back in business.

I’ve a bunch of posts with missing parents, but perhaps that’s to be expected (though there are many with the same title).

Thanks, @gerhard!

(Jay Pfaffman) #184

Is there a way to recover permalinks like /slug-tXXX-YY.html? I’d think that XXX was a topic ID and YY was, a topic/reply ID (or a page number?), but that seems not to be the case.

(Gerhard Schlager) #185

Are you referring to this?

At least in that example the number is the topic id. If it isn’t I guess you’ll have to figure that out for yourself. :wink:

(Jay Pfaffman) #186

Oh. Why, yes, precisely. What a small world. :slight_smile:

Except that for the URLs I’ve seen so far the ID in the friendly URL is not the topic ID. I guess I’ll have to go spelunking in the database.

(Eric Ladner) #187

My phpBB database is in PostgreSQL, not MySQL. will this require modifying the importer, or is there already an importer that uses PostgreSQL as the source?

(Gerhard Schlager) #188

No, the current version works only with MySQL and MariaDB. It needs some work to support other databases as well. You can send me a message if you need help adding support for PostgreSQL and have a budget. :wink:

(Eric Ladner) #189

No budget. This is just helping some friends that are migrating their gaming forum from phpBB. I’m familiar enough with PostgreSQL and MySQL that I can probably bash through it, though.

(Jay Pfaffman) #190

And the database queries are in a single file, so it should be straight forward.

(Gerhard Schlager) #192

It’s hard to say what’s causing this without seeing the database content that fails to import.
Did you post the complete stacktrace / error message?

(Opus K) #193

Thank you for your response.

Because of the e-mail problem, I re-entered, but the previous question has been erased. So include below.

The following screen shows the progress of importing process and error message.

As you can see from the error message, it is judged that an error occurred while encoding Hex value.

I will send you more information if you need more.


--------------- previous question ---------------
Hello, all The following error occurred while importing category from php3.1.x forum. creating categories /usr/local/lib/ruby/2.3.0/json/common.rb:224:in `encode’: “\xEA” from ASCII-8BIT to UTF-8(Encoding::UndefinedConversionError) I’ve tried a number of things, but the same result.