# Migrate a phpBB3 forum to Discourse

**URL:** https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810
**Category:** Migrating to Discourse
**Tags:** how-to
**Created:** [5 juli 2015 om 22:02 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810 "2015-07-05T22:02:57Z")
**Posts on this page:** 20
**Page:** 7

<div class="post-metadata">

### Author: ![okp](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@okp](https://meta.discourse.org/u/okp)
#### Post date: [9 maart 2019 om 19:00 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/438 "2019-03-09T19:00:35Z")

</div>

Hi Gerhard ! thanks a lot for the hard work. I’m using the Digital Ocean Discourse droplet

> ESK8FRDiscourse  
> 2 GB / 25 GB Disk / FRA1 - Ubuntu Discourse 2.0.20180802 on 18.04

I’m stuck on importing my phpbb raw database. I’ve uploaded the full content of your github on the server (digital ocean).

This initial command

> ruby phpbb3.rb phpbb3/settings.yml

gives me:

> **root@ESK8FRDiscourse** : **~/discourse/script/import\_scripts** # ruby phpbb3.rb phpbb3/settings.yml  
> **Traceback** (most recent call last):  
> 6: from phpbb3.rb:11:in `&lt;main&gt;' 5: from phpbb3.rb:12:in `\<module:ImportScripts\>’  
> 4: from phpbb3.rb:14:in `&lt;module:PhpBB3&gt;' 3: from phpbb3.rb:14:in `require\_relative’  
> 2: from /root/discourse/script/import\_scripts/phpbb3/database/database.rb:1:in `&lt;top (required)&gt;' 1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require’  
> /usr/lib/ruby/2.5.0/rubygems/core\_ext/kernel\_require.rb:59:in `require’: **cannot load such file – mysql2 (**  **LoadError** **)**

I don’t really know what to do; maybe it’s because i’m using the droplet discourse from digital ocean instead of @gerhard installation. I’m also not able to install a local Mysql or it will cost a new droplet

well I’m lost guys! any help is welcome!

---

<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: [10 maart 2019 om 01:23 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/439 "2019-03-10T01:23:03Z")

</div>

That’s likely not enough machine to do an import unless it’s very small. How many posts & users do you have?

If you did a one click install you can control-c out of the script and follow the instructions as if you did a proper install, though you should

```
cd /var/discourse 

```

./discourse-setup

And it’ll create swap. And maybe make the other instructions make more sense.

---

<div class="post-metadata">

### Author: ![okp](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@okp](https://meta.discourse.org/u/okp)
#### Post date: [10 maart 2019 om 08:24 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/440 "2019-03-10T08:24:15Z")

</div>

thanks Jay. I just did it and it fails

```
>FAILED
>--------------------
>Pups::ExecError: socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 &amp;&amp; echo postgres already running stop container ; exit 1 failed with return #&lt;Process::Status: pid 45 exit 1&gt;
>Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
>exec failed with the params "socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 &amp;&amp; echo postgres already running stop container ; exit 1 >24f9bd2c5a37439d0ae738c6b3eb09dc43f719dd12c8405c0056eed480d6e4c4
> **FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one
> **root@ESK8FRDiscourse** : **/var/discourse** #

```

Following your advice, I just started from scratch, recreated the droplet for Discourse on Digital Ocean. I did the ssh setup and I’m good. The Discourse forum is now back and running here

[http://forum.e-sk8.fr](http://forum.e-sk8.fr)

I’m using a A DNS value for forum.xxxx as the domain is not hosted by the same provider (here Digital Ocean) than the existing [ESK8FR - La communauté du ride électrique - ESK8FR](http://e-sk8.fr/forum) forum.

now I’m coming to how I migrate [ESK8FR - La communauté du ride électrique - ESK8FR](http://www.e-sk8.fr/forum) (3.2.1) to this discourse forum and that’s where I’m stuck. I got the raw file db export in .sql

I would love someone to help me but as it’s all personal money for a good cause; I would be able to pull out around 200/300 euros but not more. I know it’s not much but again, nothing is money driven on the ESK8FR forum.

It may also be a good option to simplify the categories to make the move simpler.

Would love to have your help Jay as you seem to be the man and it’s for a good cause 🙂

[http://forum.e-sk8.fr/t/hey-jay-help-a-brother-here/12/2](http://forum.e-sk8.fr/t/hey-jay-help-a-brother-here/12/2)

For some reasons, I went into Discourse admin and clicked “Update docker” (option was available). Went fine. Then I had the “Update Discourse” option available. I clicked “Upgrade”… and after 3 minutes it failed. Well, I didn’t gave up, so I went back to the terminal and did a ./discourse-setup and it’s running now. what a journey.

The discourse is now back up and running at the same state. It seems the “Upgrade option in Discourse just screwed the whole”, but now using the discourse-setup again, it’s now back to a proper/nominal state.

In the meanwhile and by reading a lot of tutorials, I managed to setup:

- SSL
- Adsense plugin
- Email works with Mailgun.
- I took a snapshot of the environment to avoid redoing this initial setup hundred of time and can get back to a normal initial / baseline state anytime needed.

I imagine that this may be a laugh for you experts, but for me it’s a huge win and I almost didn’t sleep this night.

So now I’m back to my initial issue (and I apologize for some of the off topic of my post) : migration from my existing forum to this brand new and lovely Discourse.

I did an export of the php 3.2.1 database in gzip

 ![29](https://global.discourse-cdn.com/meta/original/3X/8/6/86ed0e70cd15d25b84d018878eb213f6b9a0dca7.png)

and uploaded it in the right place. Renamed it accordingly

 ![12](https://global.discourse-cdn.com/meta/original/3X/7/d/7d600a5704c9316796bfcc828ae0d7d04e6156da.png)

I then run the import script

 ![29](https://global.discourse-cdn.com/meta/original/3X/8/6/86ed0e70cd15d25b84d018878eb213f6b9a0dca7.png)

I’m trying to do whatever I can but I’m stuck. At this time, the discourse was no more working and I had to come back to the snapshot

 ![59](https://global.discourse-cdn.com/meta/original/3X/7/d/7d2b8b7043b159e725ca9d876a84b15ff1afb6bf.jpeg)

So I’m now back to the initial situation.

 ![09](https://global.discourse-cdn.com/meta/original/3X/c/0/c0fe6e05157f29e53d01d213c66285ffac9c90fc.png)

 ![43](https://global.discourse-cdn.com/meta/original/3X/e/1/e1c7e11b67e642a01f4cd7349cca3fdaae6ecf74.jpeg)

My forum is super simple : users, categories, posts. No polls, attachements uploads or whatever. I believe this could be achievable but I’m stuck

---

<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: [10 maart 2019 om 12:33 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/441 "2019-03-10T12:33:10Z")

</div>

How many users? How many posts?

To get the forum back you need to stop the import container and start the app container.

---

<div class="post-metadata">

### Author: ![okp](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@okp](https://meta.discourse.org/u/okp)
#### Post date: [10 maart 2019 om 12:38 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/442 "2019-03-10T12:38:13Z")

</div>

Hey Jay : From the early start of the forum : 3500 topics and 700 declared users (and probably way less as I’m pruning the accounts while we talk). More than 300 hundreds never posted or last active date was 3 yeas ago), but from what I see, less than 30 users are “active posters”. There are a lot of users that didn’t connected for a while. Average 30/40 posts a day, which is barely nothing.

I’ve continued, still trying to figure out what’s wrong.

I’ve copied the script folder in my home folder

 ![30](https://global.discourse-cdn.com/meta/original/3X/8/5/85c9083d3cc3b47d3601727d3dfe0f3ae0bf14d1.jpeg)

when I run

> **root@ESK8FRDiscourse** : **~/script/import\_scripts** # ruby phpbb3.rb phpbb3/settings.yml

It says that that ruby is not found, so I installed it using

> **root@ESK8FRDiscourse** : **~/script/import\_scripts** # apt install ruby

install goes fine.

Then I launch

> **root@ESK8FRDiscourse** : **~/script/import\_scripts** # ruby phpbb3.rb phpbb3/settings.yml

and I get

 ![24](https://global.discourse-cdn.com/meta/original/3X/9/7/97a69debe64490d3d3cb14d4e540b99f43bd1c3a.jpeg)

and I’m stuck again 🙂

and… back to the original initial state.

 ![21](https://global.discourse-cdn.com/meta/original/3X/8/0/8075db9cc90e4ac81669e32007a2112b42536282.jpeg)

if someone could provide me a walkthrough that we be SO awesome cause I don’t know what to do.

As per the nature of phpbb, I had in my forum a thread where people post a link to video they like or a photo. I don’t care of saving that and migrating these. These will save more than 3000 posts that can be removed too. There is also a category where people post they “group ride” notification. I also don’t care about it.. It’s 6000 posts so far that could be removed.

So we are really talking about a very limited amount of data to “migrate”.

---

<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: [10 maart 2019 om 20:55 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/443 "2019-03-10T20:55:28Z")

</div>

How many total posts?

From an import perspective, there is no train to prune the users. 700 is not many. You really don’t want to remove a user who had posts.

You should be following the “Importing using Docker container” section of the OP.

---

<div class="post-metadata">

### Author: ![okp](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@okp](https://meta.discourse.org/u/okp)
#### Post date: [10 maart 2019 om 21:07 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/444 "2019-03-10T21:07:56Z")

</div>

Hey Jay, 80 000 total posts. I read the full thread around 100 times for around 2 days now eheh. I just don’t get it. All my previous posts are a complete end to end follow up of the OP. The OP gives a non compatibility with phpbb 3.2.x as a result

---

<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: [11 maart 2019 om 20:11 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/445 "2019-03-11T20:11:16Z")

</div>

You are not following the docker instructions. Your files are not where the OP describes and you didn’t do this:

> [@gerhard](#):
>
> /var/discourse/launcher enter import import\_phpbb3.sh # inside the Docker container

It looks the 3.2 changes have not been merged. I think there’s a link in this topic, but if you can’t follow the instructions the OP then integrating the other code will be even more mystifying.

With the 3.2 complexity it’s not a job I would touch for under $1000 (but that’s not a promise). My advice is to see if your community is interested in crowd funding the migration.

---

<div class="post-metadata">

### Author: ![okp](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@okp](https://meta.discourse.org/u/okp)
#### Post date: [23 maart 2019 om 07:18 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/446 "2019-03-23T07:18:38Z")

</div>

thanks !! @gerhard did you manage to move towards a proper release for phpbb 3.2.x (I’m running 3.2.1. That will ease my life so much!!!

---

<div class="post-metadata">

### Author: ![Jeremiah\_Sherrill](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeremiah_sherrill/32/138318_2.png) [@Jeremiah\_Sherrill](https://meta.discourse.org/u/Jeremiah_Sherrill)
#### Post date: [13 april 2019 om 19:05 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/447 "2019-04-13T19:05:30Z")

</div>

I don’t have a lot of money but I would chip in to pay for a migration for 3.2.1 to discourse. Perhaps if we all create a fund we can raise enough money to get this done.

---

<div class="post-metadata">

### Author: ![FoohonPie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foohonpie/32/119648_2.png) [@FoohonPie](https://meta.discourse.org/u/FoohonPie)
#### Post date: [13 april 2019 om 20:22 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/448 "2019-04-13T20:22:47Z")

</div>

I’d be down to pitch in what I can.

@gerhard do you have a sense of how much work remains, and how much budget it might take to get there?

Thanks.

---

<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: [15 april 2019 om 15:34 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/449 "2019-04-15T15:34:18Z")

</div>

For a frame of reference, I did a small 3.2 import for something over $2000 last August. I handed my code over to Gerhard, but it wasn’t pretty. If your budget is in that range and you want the job done–as opposed to having code that is up to Gerhard’s standards (which is beautiful, and often does things that to me seem magical), please contact me.

I’d guess (but certainly don’t know, as I don’t work for them), that you could likely pay for a year of Standard hosting (and almost certainly Business-level hosting) and get an import, which would result in the importer getting updated.

---

<div class="post-metadata">

### Author: ![FoohonPie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foohonpie/32/119648_2.png) [@FoohonPie](https://meta.discourse.org/u/FoohonPie)
#### Post date: [22 april 2019 om 21:56 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/450 "2019-04-22T21:56:39Z")

</div>

Thanks @pfaffman!

I don’t have the budget for that, unfortunately, so I’m hoping that group funding may be viable.

I appreciate the offer though. 🙂

---

<div class="post-metadata">

### Author: ![alb](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@alb](https://meta.discourse.org/u/alb)
#### Post date: [17 mei 2019 om 22:06 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/451 "2019-05-17T22:06:35Z")

</div>

This page is a great source for importing to Discourse. Thanks for the contributions.  
I used Permalinks with prefix and it worked the way I wanted to import from PHPBB to Discourse. I added forum as prefix in settings.yml to redirect from /forum/viewtopic.php?f=6&t=43 to /t/topic-name/81  
The issue I have is the case insensitivity. some or pages have been indexed at google or other search engines as /Forum/viewtopic.php?f=6&t=43 and because of “F” in Forum, it is not redirected! Any thoughts how I can fix this?

---

<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: [17 mei 2019 om 22:26 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/452 "2019-05-17T22:26:48Z")

</div>

I think you can add a `permalink redirect` with the `F`.

---

<div class="post-metadata">

### Author: ![alb](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@alb](https://meta.discourse.org/u/alb)
#### Post date: [17 mei 2019 om 22:31 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/453 "2019-05-17T22:31:35Z")

</div>

Then lower case f would not work!

---

<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: [17 mei 2019 om 22:46 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/454 "2019-05-17T22:46:25Z")

</div>

You can have multiple permalink redirects.

---

<div class="post-metadata">

### Author: ![alb](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@alb](https://meta.discourse.org/u/alb)
#### Post date: [17 mei 2019 om 22:55 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/455 "2019-05-17T22:55:10Z")

</div>

You mean something like this:  
prefix: forum  
prefix: Forum

Will try? Is this making a duplicate map then!

---

<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: [17 mei 2019 om 22:55 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/456 "2019-05-17T22:55:27Z")

</div>

Only one will match.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [17 mei 2019 om 22:56 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/457 "2019-05-17T22:56:27Z")

</div>

Add additional permalink normalizations. There’s a site setting for this.

[Previous page](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810.md?page=6)

[Next page](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810.md?page=8)
