# Re: Migrate a phpBB3 forum to Discourse

**URL:** https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233
**Category:** Migration
**Created:** [March 20, 2024, 7:12pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233 "2024-03-20T19:12:13Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 20, 2024, 7:12pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/1 "2024-03-20T19:12:14Z")

</div>

Hi,

Is phpBB3.3.3 supported or is it strictly 3.3.0? When performing the 1.5 step:

/var/discourse/launcher enter import

from [Migrate a phpBB3 forum to Discourse - documentation / sysadmin - Discourse Meta](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810)  
I’m receiving (already tried twice) the response:

x86\_64 arch detected.  
Error response from daemon: No such container: import

If I use  
/var/discourse/launcher enter import.yml

the response is:

x86\_64 arch detected.  
ERROR: containers/import.yml.yml does not exist or is not readable.  
Available configs ( app, import )

Any chances this can work?

Thanks

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [March 20, 2024, 7:38pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/2 "2024-03-20T19:38:32Z")

</div>

Hi, welcome! 👋

I assume you followed the guide from the start; is `/var/discourse/containers/import.yml` file actually present?

It looks like the config file has been deleted. 🤔

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 20, 2024, 7:43pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/3 "2024-03-20T19:43:23Z")

</div>

Yes, it’s like in the message above, both app.yml and import.yml are present in the “containers” directory.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [March 20, 2024, 8:09pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/4 "2024-03-20T20:09:04Z")

</div>

If I understand well, you had no issue following the previous steps, creating/editing the `import.yml` next to `app.yml`, rebuilding the `import` container, and now you can’t even enter it. Is that right? That’s odd for sure!

What returns this command? `ls -l /var/discourse/containers`

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 20, 2024, 8:19pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/5 "2024-03-20T20:19:46Z")

</div>

It’s still the same: app.yml and import.yml (plus a “bak” file of app.yml).

There might be “issues” as I’ve been trying to install this on Lightsail 1GB (which is initially 940 and after updating Ubuntu becomes “921MB”). I used the official installation and what was installed was something like 3.3.\* beta-something (while Wiki shows 3.2 as the most recent stable version). Installation takes 1h15min-1h20min with 4GB swap. the “launcher rebuild import” about 2h.  
Could something be incorrectly terminated due to the low memory condition?

Btw, will backup files from the 2GB setup be readable in the 1GB setup?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [March 20, 2024, 8:51pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/6 "2024-03-20T20:51:19Z")

</div>

> [@JPD](#):
>
> “launcher rebuild import” about 2h

Was it successful? After a rebuild, the container should be started.  
You can’t enter the container if it’s not started (`./launcher start import`)

> [@JPD](#):
>
> Could something be incorrectly terminated due to the low memory condition?

That would likely be the case. There are several topics related to low memory/swap and rebuilding failure here – there is usually no choice but to increase RAM/swap.

I’m not an expert here, but hopefully, someone can give you better insight.

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 21, 2024, 12:03am UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/7 "2024-03-21T00:03:50Z")

</div>

Apparently, RAM _is_ an issue. For the Lightsail 2GB/2GB, the clean installation is about 3.5-4x faster and the rebuilding of the import container was about (or even over) 10x faster.  
Still, I’m afraid the import script might not work for phpBB 3.3.3. Anyway, I tried twice with the same result: only one word from one category name (out of ~10 categories) was imported as one empty “category”. The MySQL textual dump is pretty small 2.66MB. All table prefixes are as required. No images, no smilies etc.  
All in all, no forums, no forum categories or posts, but all (a few hundred) users were imported correctly along with their statistics.

It seems phpBB 3.3.3 was the update that changed something about the used MySQL version, but this is a dump file here, so it shouldn’t matter after all.  
Any ideas what else can be checked?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 21, 2024, 8:49am UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/8 "2024-03-21T08:49:01Z")

</div>

I would recommend at least 4gb of ram.

Are there any errors? It sounds like the script quit after it got one category?

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 21, 2024, 9:38am UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/9 "2024-03-21T09:38:00Z")

</div>

You mean 4GB to open/read/parse that 2.6MB text file? Are you the Discourse developer? A binary executable to read that dump (extracting all the data used by Discourse) and save it to anything else should be imo around 200KB with a, say, 100KB buffer (without bothering with the inclusion of the whole MariaDB for this simple action).

I think it’s not about RAM. The procedure was fast and displayed importing progress for those imported tables. It didn’t “quit”. The users’ table is at the end of the dump, after the topics etc.

I wanted to do this again, experimenting with copying/pasting that users table to the top and perform the same steps from the above manual/page (also with a dump created by phpMyAdmin instead of phpBB), but now Discourse refuses to start the procedure trying to connect remotely although no connection data was added.

I rebuilt the import container, but perhaps something has to be deleted first?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 21, 2024, 10:33am UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/10 "2024-03-21T10:33:58Z")

</div>

I make my living supporting discourse and have done more migrations than I can count, but I think a hundred or more. 2gb will likely work, especially if you have only a few thousand topics and users, but since you need it for unit a small amount of time, more ram isn’t expensive and can’t hurt. I agree that it’s likely not the problem.

When the script ran, did it count through the categories, users, topics, and posts?

The script will skip over imported data, and creates custom field data to skip those in the future, so to run it again, you need to wipe the discourse database. Since you say it didn’t import anything it’s not clear whether that’s necessary. It would seem that either it did import it and you can’t find it for some reason, or it failed because it didn’t find the data, and you need to modify the script somehow; in neither of those cases should you need to wipe the database.

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 21, 2024, 12:03pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/11 "2024-03-21T12:03:15Z")

</div>

> Since you say it didn’t import anything

Not exactly:  
" all (a few hundred) users were imported correctly along with their statistics"

I tried to rebuild the container again. The same settings. I didn’t change anything and after the step:  
import\_phpbb3.sh # inside the Docker container  
the script now displays:  
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mysql2-0.5.6/lib/mysql2/client.rb:97:in `connect’: Unknown database ‘phpbb’ (Mysql2::Error)

Perhaps there are still some previously used temporary files to delete?

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 21, 2024, 10:38pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/12 "2024-03-21T22:38:16Z")

</div>

I eventually used the dump from phpMyAdmin. Is there any example (or some more detailed specs) how to create the mapping sections in the (import) settings.yml?  
My php\_forums table looks like the following:

```plaintext
forum_id, MEDIUMINT(8) ...	parent_id, MEDIUMINT(8) ...
3	0
8	3
7	3
9	3
10	3
11	0
12	11
13	11
14	11
15	11
17	3

```

It seems that whichever ids I use and no matter whether I also specify the “new\_categories: ” section, the message generated by the import container is ok:  
creating new categories  
11 / 11 (100.0%) [2803 items/min] n]  
creating categories  
11 / 11 (100.0%) [2704 items/min]

but what is created are two main categories (that were “forums” in the phpBB with the parent\_id 0) and one empty subcategory in each one of them. The procedure does import all posts but they are all "orphaned’.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 22, 2024, 1:16am UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/13 "2024-03-22T01:16:31Z")

</div>

Sounds like something has changed for your version of phpbb3.

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 22, 2024, 2:18am UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/14 "2024-03-22T02:18:57Z")

</div>

Well, actually, I made one step forward fixing my own error: I just placed comments in the settings.yml file using the C/C++ style, at the line ends. This apparently prevented the subforums to be “processed” (though no errors were displayed).

I added the categories and subcategories as “new” and mapped the older ids.  
Still there are all the posts not attached to any category. Are such topics stored in one Postgres table? How they can be deleted?

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 22, 2024, 3:46pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/15 "2024-03-22T15:46:29Z")

</div>

I added some fixes to the phpbb\_mysql.sql at least to let the script create all the original categories, but it’s not enough.  
When processing topics/posts there is just a long list of the type:

```plaintext
Parent post [some id] doesn't exist. Skipping [some id]

```

and, of course, there are no posts imported.  
I wonder if anyone could confirm that the default scripts don’t work with phpBB 3.3.3 tables?

---

<div class="post-metadata">

### Author: ![JPD](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jpd/32/371816_2.png) [@JPD](https://meta.discourse.org/u/JPD)
#### Post date: [March 23, 2024, 8:18pm UTC](https://meta.discourse.org/t/re-migrate-a-phpbb3-forum-to-discourse/300233/16 "2024-03-23T20:18:45Z")

</div>

Eventually I was able to use the phpBB3.3.3 dump file without defining the categories as new and without all the mapping in the settings.yml file.

With the original phpBB\_mysql.sql dump file the migration script quits the step where categories are loaded and displays an error about “an empty category body”.  
It occurs if the “forum\_desc” field in the “phpbb\_forums” table for the main forum categories (that don’t have parent categories).  
After importing only that 1st category partially, the rest apparently becomes messed up.  
Using a fresh installation and entering some text in the above table fields seems to solve this issue.
