# 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:** [July 5, 2015, 10:02pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810 "2015-07-05T22:02:57Z")
**Posts on this page:** 20
**Page:** 23

<div class="post-metadata">

### Author: ![GeoffSchultz](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@GeoffSchultz](https://meta.discourse.org/u/GeoffSchultz)
#### Post date: [September 5, 2024, 12:00pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/777 "2024-09-05T12:00:58Z")

</div>

> [@GeoffSchultz](#):
>
> `psych.rb`

I put them in with no difference.

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [September 5, 2024, 12:46pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/778 "2024-09-05T12:46:05Z")

</div>

> [@GeoffSchultz](#):
>
> ```plaintext
> table_prefix: phpbb_ # Change this, if your forum is using a different prefix. Usually all table names start wi
> th phpbb_
> batch_size: 1000 # Don't change this unless you know what you're doing. The default (1000) should work just fin
> e.
> 
> ```

> [@GeoffSchultz](#):
>
> ```plaintext
> # Append a prefix to each type of link, e.g. 'forum' to redirect /forum/viewtopic.php?f=6&t=43 to /t/topic-na
> me/81
> 
> ```

> [@GeoffSchultz](#):
>
> ```plaintext
> remote: false # WARNING: This can considerably slow down your import. It will try to download remote avatar
> s.
> 
> ```

Not sure if these are errors from being pasted or if that’s how it actually is in your yml file, but those would cause issues. (Line breaks near the end of some comments, causing a second, un-commented, line to exist)

---

<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: [September 5, 2024, 5:39pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/779 "2024-09-05T17:39:35Z")

</div>

Your list items aren’t indented correctly.

> [@GeoffSchultz](#):
>
> ```plaintext
> new_categories: 
> - forum_id: general
> name: General
> 
> ```

The above should be

```plaintext
  new_categories: 
    - forum_id: general
      name: General

```

I recommend using [https://www.yamllint.com/](https://www.yamllint.com/) to validate your config file.

---

<div class="post-metadata">

### Author: ![GeoffSchultz](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@GeoffSchultz](https://meta.discourse.org/u/GeoffSchultz)
#### Post date: [September 5, 2024, 11:05pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/780 "2024-09-05T23:05:35Z")

</div>

Thank you for all of your replies. I quickly figured out that editing settings.yml outside of the import container, didn’t effect what was running. I also figured out about the yml whitespace, and corrected my settings file. Anyhow, the import of the phpBB forum went well, except…

My username on the phpBB was the same as my admin account on Discourse. I can’t log in, and there’s a message that:

```plaintext
All outgoing email has been globally disabled by an administrator. No email notifications of any kind will be sent.

```

As a result, I can’t get a reset password email sent. Is this a database setting? And if so, can I update that field using the limited resources of the container? Any other ideas?

Note that I have the migratepassword plugin installed, but that doesn’t seem to work (perhaps because my password was less than 15 characters)

---

<div class="post-metadata">

### Author: ![cocococosti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cocococosti/32/231474_2.png) [@cocococosti](https://meta.discourse.org/u/cocococosti)
#### Post date: [September 6, 2024, 8:47pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/781 "2024-09-06T20:47:08Z")

</div>

> [@GeoffSchultz](#):
>
> My username on the phpBB was the same as my admin account on Discourse. I can’t log in, and there’s a message that:
> 
> ```plaintext
> All outgoing email has been globally disabled by an administrator. No email notifications of any kind will be sent.
> 
> ```

You can enable emails for admin users from the rails console:

```plaintext
./launcher enter import
rails c
> SiteSetting.disable_emails = "non-staff"

```

You can also reset your password directly from the container, no need to use emails, by running:

```plaintext
./launcher enter import
rake admin:create

```

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [December 24, 2024, 7:39pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/782 "2024-12-24T19:39:26Z")

</div>

May I suggest a few changes to this documentation (and code):

> [@Discourse](#):
>
> Enable `disable_edit_notifications` if you enabled `download_remote_images_to_local` and  
> don’t want your users to get lots of notifications about posts edited by the system user.

- This is no longer needed as the `disable_edit_notifications` setting doesn’t exist anymore. `disable system edit notifications` does the mentioned job and is enabled by default.

> [@Discourse](#):
>
> ```plaintext
> ## Uncomment these two lines if you wish to add Lets Encrypt (https)
> #- "templates/web.ssl.template.yml"
> #- "templates/web.letsencrypt.ssl.template.yml"
> - "templates/import/phpbb3.template.yml"
> 
> ```

- The two SSL lines are no longer commented by default in `app.yml`, so removing these two `#` will make the excerpt more accurate to what it should look like.

> [@Roi](#):
>
> ```plaintext
> hooks:
> after_web_config:
> - exec:
> cd: /etc/service
> cmd:
> # - rm -R unicorn
> - rm -R nginx
> - rm -R cron
> 
> ```
> 
> I commented the line `- rm -R unicorn` in `templates/import/phpbb3.template.yml` and the build went through without the error.
> 
> What happened here? `phpbb3.template.yml` is the version from Github, two years old. So there must be a change somewhere else?!?

- This template should be updated so users don’t experience this error when importing.

- Also this (unless I did a mistake somewhere, it’s also something that should be fixed):  
Running `IMPORT=1 bundle install` returned:

I used a dev install for my import, if it matters.

---

<div class="post-metadata">

### Author: ![For](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@For](https://meta.discourse.org/u/For)
#### Post date: [January 31, 2025, 3:52pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/784 "2025-01-31T15:52:49Z")

</div>

That information should be mentioned in the instructions or the template should be updated. This took me some hours..

---

<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: [January 31, 2025, 4:05pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/785 "2025-01-31T16:05:23Z")

</div>

> [@For](#):
>
> That information should be mentioned in the instructions

What does it need to say?

---

<div class="post-metadata">

### Author: ![For](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@For](https://meta.discourse.org/u/For)
#### Post date: [January 31, 2025, 4:11pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/786 "2025-01-31T16:11:33Z")

</div>

> [@pfaffman](#):
>
> I think if you delete a line in the phpbb3 template that deletes “/etc/service/unicorn/run” that might make the build complete.

Deleting this line made the successful construction of the container possible.

---

<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: [January 31, 2025, 4:52pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/787 "2025-01-31T16:52:59Z")

</div>

So you removed this line?

> <https://github.com/discourse/discourse_docker/blob/main/templates/import/phpbb3.template.yml#L11>

---

<div class="post-metadata">

### Author: ![For](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@For](https://meta.discourse.org/u/For)
#### Post date: [January 31, 2025, 4:56pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/788 "2025-01-31T16:56:02Z")

</div>

Yes, that was the solution.

---

<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: [January 31, 2025, 4:57pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/789 "2025-01-31T16:57:53Z")

</div>

[https://github.com/discourse/discourse\_docker/pull/934](https://github.com/discourse/discourse_docker/pull/934)

---

<div class="post-metadata">

### Author: ![Frenky](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@Frenky](https://meta.discourse.org/u/Frenky)
#### Post date: [March 2, 2025, 10:40pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/795 "2025-03-02T22:40:50Z")

</div>

“Hi, I have successfully migrated my phpBB forum to Discourse, everything went smoothly, and the forum is running great. Now I’ve realized that I didn’t enable binary mode during the FTP download of the phpBB data, which means all the images are corrupted. I’ve run the script again, but the images aren’t being overwritten. Which script, preferably with the path, do I need to modify so that the corrupted images and attachments are overwritten?”

---

<div class="post-metadata">

### Author: ![jahan\_gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jahan_gagan/32/501948_2.png) [@jahan\_gagan](https://meta.discourse.org/u/jahan_gagan)
#### Post date: [March 2, 2025, 11:18pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/796 "2025-03-02T23:18:13Z")

</div>

In your second trial, Discourse is skipping the uploads because they already exist in the `uploads` table. Discourse avoids overwriting existing uploads unless explicitly instructed.

You can try adding the below code snippet in `attachment_importer.rb` ([discourse/script/import\_scripts/phpbb3/importers/attachment\_importer.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/script/import_scripts/phpbb3/importers/attachment_importer.rb#L25)) before calling `@uploader.create_upload` will ensure that any existing upload with the same filename is **deleted first** , forcing Discourse to re-upload it.

```plaintext
existing_upload = Upload.find_by(original_filename: filename)
if existing_upload
  existing_upload.destroy
  puts "Deleted existing upload: #{filename}"
end

upload = @uploader.create_upload(user_id, path, filename)

```

---

<div class="post-metadata">

### Author: ![Frenky](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@Frenky](https://meta.discourse.org/u/Frenky)
#### Post date: [March 3, 2025, 7:45am UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/797 "2025-03-03T07:45:40Z")

</div>

“Thank you for your response. Unfortunately, the change didn’t have any effect. The script runs through in just one minute, but the attachments are not being overwritten…”

---

<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 3, 2025, 1:13pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/799 "2025-03-03T13:13:42Z")

</div>

You’ll probably need to wipe the database and run it again.

---

<div class="post-metadata">

### Author: ![Frenky](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@Frenky](https://meta.discourse.org/u/Frenky)
#### Post date: [March 3, 2025, 2:55pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/800 "2025-03-03T14:55:48Z")

</div>

How do I do that?

---

<div class="post-metadata">

### Author: ![jahan\_gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jahan_gagan/32/501948_2.png) [@jahan\_gagan](https://meta.discourse.org/u/jahan_gagan)
#### Post date: [March 3, 2025, 6:20pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/801 "2025-03-03T18:20:05Z")

</div>

**Step 1:** Connect to the server via SSH:

```plaintext
ssh username@server-address

```

**Step 2:** Access the application container:

```plaintext
./launcher enter import

```

_Tip: Run `docker ps` to find the container name. By default, it is usually named **app**._

**Step 3:** Reset the database:

```plaintext
RAILS_ENV=production rake db:reset

```

---

<div class="post-metadata">

### Author: ![Ahmed\_Gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_gagan/32/161985_2.png) [@Ahmed\_Gagan](https://meta.discourse.org/u/Ahmed_Gagan)
#### Post date: [March 13, 2025, 11:51am UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/804 "2025-03-13T11:51:28Z")

</div>

Hey Canapin,

> [@Canapin](#):
>
> This is no longer needed as the `disable_edit_notifications` setting doesn’t exist anymore. `disable system edit notifications` does the mentioned job and is enabled by default.

I’ve updated this part in the guide.

> [@Canapin](#):
>
> The two SSL lines are no longer commented by default in `app.yml`, so removing these two `#` will make the excerpt more accurate to what it should look like.

It depends. It’s still commented out when setting up the container for localhost. The guide assumes that a separate container is used for imports, which isn’t accessible over the internet, so obtaining certificates isn’t necessary in this case.

> [@Canapin](#):
>
> This template should be updated so users don’t experience this error when importing.

A PR for this has now been merged into core.

> [@Canapin](#):
>
> Also this (unless I did a mistake somewhere, it’s also something that should be fixed):  
> Running `IMPORT=1 bundle install` returned:

We are working on a fix for this, but I’ve updated the guide and added an FAQ on how to resolve this issue.

---

<div class="post-metadata">

### Author: ![MichaIng](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaing/32/251089_2.png) [@MichaIng](https://meta.discourse.org/u/MichaIng)
#### Post date: [September 2, 2025, 6:33pm UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/805 "2025-09-02T18:33:07Z")

</div>

When Discourse runs in a sub directory, like `domain.org/forum`, the permalinks do not apply, since they are like `viewtopic.php?p=XXXX`, but should be `forum/viewtopic.php?p=XXXX` to work.

It has been years, but I stumbled over the never functional permalinks still configured in our case. Is there a GUI/CLI way to prefix all permalinks with an URL path element, or can someone add a PostgreSQL query to do this? Might help as well others, if this info is added to first post.

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

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