# Enhancement request to phpBB3 import script

**URL:** https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476
**Category:** Migration
**Tags:** phpbb
**Created:** [January 14, 2026, 8:04pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476 "2026-01-14T20:04:29Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 7:47pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/21 "2026-01-15T19:47:38Z")

</div>

Tried this too:

> root@vps116136-import:/var/www/discourse/config# su discourse -c “bundle exec rake db:drop”  
> exec: line 1: “bundle: command not found

---

<div class="post-metadata">

### Author: ![italo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/italo/32/315833_2.png) [@italo](https://meta.discourse.org/u/italo)
#### Post date: [January 15, 2026, 7:56pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/22 "2026-01-15T19:56:49Z")

</div>

Sorry, I should have anticipated these checks.

Try running the drop command with this env variable:

```bash
cd /var/discourse
./launcher enter <your-container-name>

su discourse
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop

```

> [@shortmort37](#):
>
> root@vps116136-import:/var/www/discourse/config#

This particular one didn’t worked out because you were not in the directory where the Gemfile of the project is, in your case: `/var/www/discourse`.

A quick note: the easier way would be having a backup from the very first start of the forum, so you would just restore it before trying to import again, but assuming you didn’t had that we were left with that soft reset.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 8:04pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/23 "2026-01-15T20:04:23Z")

</div>

Still no love.

```plaintext
root@vps116136-import:/var/www/discourse# su discourse
discourse@vps116136-import:/var/www/discourse$ DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop
PG::InsufficientPrivilege: ERROR: must be owner of database discourse
Couldn’t drop database ‘discourse’
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: must be owner of database discourse (ActiveRecord::StatementInvalid)

…

```

Trying now as root…

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 8:09pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/24 "2026-01-15T20:09:10Z")

</div>

Nope.

> root@vps116136-import:/var/www/discourse# DISABLE\_DATABASE\_ENVIRONMENT\_CHECK=1 bundle exec rake db:drop  
> fatal: detected dubious ownership in repository at ‘/var/www/discourse’  
> To add an exception for this directory, call:
> 
> > ```plaintext
> > git config --global --add safe.directory /var/www/discourse
> > 
> > ```
> > 
> > rake aborted!

---

<div class="post-metadata">

### Author: ![italo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/italo/32/315833_2.png) [@italo](https://meta.discourse.org/u/italo)
#### Post date: [January 15, 2026, 8:15pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/25 "2026-01-15T20:15:12Z")

</div>

Forget my first instructions 🥲

1. Docker cp your latest backup out of the container. Backups live inside `/shared/backups/default`.
2. Delete the shared folder from your installation directory (the place where you call ./launcher from): `rm -rf /var/discourse/shared`
3. Rebuild the container using `./launcher rebuild <container-name>`.

This should do the trick, but be careful not to lose your backup. I was trying to avoid to suggest it so you don’t accidentally delete your backup, but seems to be the only path forward.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 8:21pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/26 "2026-01-15T20:21:20Z")

</div>

> [@italo](#):
>
> Docker cp your latest backup out of the container. Backups live inside `/shared/backups/default`.

Gonna take a while. the tar.gz is 15GB.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 8:23pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/27 "2026-01-15T20:23:36Z")

</div>

In fact, it’s gonna take…

![200](https://global.discourse-cdn.com/meta/original/4X/b/0/b/b0bc037671741900d3fffc371ae0f2d932e2e33a.gif)

It’s done .5GB since I’ve started.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 9:13pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/28 "2026-01-15T21:13:27Z")

</div>

> [@italo](#):
>
> Docker cp your latest backup out of the container. Backups live inside `/shared/backups/default`.

Finished.

> [@italo](#):
>
> Delete the shared folder from your installation directory (the place where you call ./launcher from): `rm -rf /var/discourse/shared`

Done.

> [@italo](#):
>
> Rebuild the container using `./launcher rebuild <container-name>`.

Complete. Ready to run the import script, but…

> /var/discourse/shared/standalone/import  
> ├── data  
> ├── mysql  
> └── settings.yml

I blew this ☝ away, didn’t I.

---

<div class="post-metadata">

### Author: ![italo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/italo/32/315833_2.png) [@italo](https://meta.discourse.org/u/italo)
#### Post date: [January 15, 2026, 9:22pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/29 "2026-01-15T21:22:39Z")

</div>

> [@shortmort37](#):
>
> I blew this ☝ away, didn’t I.

Yes.

I’m assuming you created a volume for your mysql container inside the shared folder. If so, unfortunately you will have to re-spin the container and restore the database again.

The attachments you can just copy over.

The settings.yml shouldn’t be that difficult to setup again.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 9:33pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/30 "2026-01-15T21:33:10Z")

</div>

> [@italo](#):
>
> I’m assuming you created a volume for your mysql container inside the shared folder. If so, unfortunately you will have to re-spin the container and restore the database again.

I’m not sure what re-spinning a container means. The first time I placed `phpbb_mysql.sql` in the mysql directory per [these instructions](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810). Is there more to do than that?

> The attachments you can just copy over.

Yeah. ‘cept, the tar.gz is 15GB because there’s 45GB of data in the phpBB `/files` directory. I have been running my board for 22 years, doncha know! So yes, I’ll copy them back. But likely, it will be tomorrow before I pick this up again.

---

<div class="post-metadata">

### Author: ![italo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/italo/32/315833_2.png) [@italo](https://meta.discourse.org/u/italo)
#### Post date: [January 15, 2026, 9:40pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/31 "2026-01-15T21:40:38Z")

</div>

> [@shortmort37](#):
>
> Yeah. ‘cept, the tar.gz is 15GB because there’s 45GB of data in the phpBB `/files`

Yeah that’s the nature of community migrations. A good advice would be starting with a smaller sample and after you nail the process you can run a full import.

There are efforts on the go to make the tooling more flexible and the process less redundant, but this is a very complex subject.

I hope everything goes well in your run Tomorrow.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 15, 2026, 9:52pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/32 "2026-01-15T21:52:19Z")

</div>

> [@italo](#):
>
> Yeah that’s the nature of community migrations. A good advice would be starting with a smaller sample and after you nail the process you can run a full import.

Agreed! But phpBB doesn’t make it easy to reduce the sample size. I’m kinda stuck with what I have. Still, it was a test environment, and nothing is irretrievable.

> [@italo](#):
>
> I hope everything goes well in your run Tomorrow.

Thanks! I will post back here. BTW, now that I’m a `docker cp` expert 🤪 , would it be a big deal to modify the ruby script to print out the phpBB `post_id` when something like this occurs?

`8000 / 24451 ( 32.7%) [677 items/min] W, [2026-01-13T02:50:22.466363 #25640] WARN – : Bad date/time value “0000:00:00 00:00:00”: mon out of range`  
`W, [2026-01-13T02:50:22.466500 #25640] WARN – : Bad date/time value “0000:00:00 00:00:00”: mon out of range`  
`W, [2026-01-13T02:50:22.466600 #25640] WARN – : Bad date/time value “0000:00:00 00:00:00”: mon out of range`

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 16, 2026, 11:19pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/33 "2026-01-16T23:19:03Z")

</div>

I’m still here! Cleaning up some things, before I redo the import, and working through some snags. Waiting for Claude to give me the time of day, before I work through the next one. But, I will be back…

![disperse-lesley-nielsen](https://global.discourse-cdn.com/meta/original/4X/9/6/e/96e4d4aaf21a0da0510e4f90a57ffb7cb7305678.gif)

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 16, 2026, 11:37pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/34 "2026-01-16T23:37:49Z")

</div>

OK! I sorted through my last snap without Claude’s help, and started the import. Yet-another-snag:

> The phpBB3 import is starting…
> 
> /var/www/discourse/script/import\_scripts/phpbb3/support/settings.rb:49:in initialize’: undefined method `[]’ for nil (NoMethodError)

```plaintext
  @site_name = import_settings["site_name"]
                              ^^^^^^^^^^^^^
    from /var/www/discourse/script/import_scripts/phpbb3/support/settings.rb:11:in `new'
    from /var/www/discourse/script/import_scripts/phpbb3/support/settings.rb:11:in `load'
    from script/import_scripts/phpbb3.rb:20:in `<module:PhpBB3>'
    from script/import_scripts/phpbb3.rb:16:in `<module:ImportScripts>'
    from script/import_scripts/phpbb3.rb:15:in `<main>'

```

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 16, 2026, 11:43pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/35 "2026-01-16T23:43:46Z")

</div>

NVM, my bad. the settings.yml file is hosed. Apologies, it will probably be tomorrow when I get back to this.

---

<div class="post-metadata">

### Author: ![italo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/italo/32/315833_2.png) [@italo](https://meta.discourse.org/u/italo)
#### Post date: [January 17, 2026, 1:01am UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/36 "2026-01-17T01:01:49Z")

</div>

> [@shortmort37](#):
>
> would it be a big deal to modify the ruby script to print out the phpBB

You could play around with pry debugging, you can add breakpoints in the code to open pry when they are executed. This allows you to get an interactive cli to take a look at the data. Or simply add a `puts row[:post_id]` in the `process_post` method, so when it gives the warning you can see the last id.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 17, 2026, 2:31am UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/37 "2026-01-17T02:31:36Z")

</div>

> [@italo](#):
>
> Or simply add a `puts row[:post_id]` in the `process_post` method, so when it gives the warning you can see the last id.

Yeah - that! Simple for you, not so much for me 🤪 I did use Xdebug extensively for server-side debugging of PHP as I developed my hacks, but I’m officially at the “old dog and new tricks” stage of my life. If you can provide me with chapter and verse, I’d love to make that edit - but I’m not going to pretend I can hack ruby. Not yet, anyway…

P.S. Claude will grant me an audience in 28 minutes, I hope to get the import underway after I get past my current snag.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 17, 2026, 3:37am UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/38 "2026-01-17T03:37:09Z")

</div>

OK, the import script is running with the revised .rb files. I’ll report back (_yawn_) in the morning.

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 17, 2026, 4:32pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/39 "2026-01-17T16:32:18Z")

</div>

Uh-oh. Here’s what I’m seeing in a post with lots of pix:

> Before the MBC can be installed the push rod grommet of the original master should be installed. The grommet delivered with the kit is too small. Removing the air pressure tank of the PS-unit gives a free access to place the new brake lines.
> 
> ~~[attachment=13]~~51.jpg[/attachment]~~[attachment=12]~~52.jpg[/attachment]~~[attachment=11]~~53.jpg[/attachment]~~[attachment=10]~~54.jpg[/attachment]~~[attachment=9]~~55.jpg[/attachment]~~[attachment=8]~~56.jpg[/attachment]~~[attachment=7]~~57.jpg[/attachment]~~[attachment=6]~~58.jpg[/attachment]~~[attachment=5]~~59.jpg[/attachment]~~[attachment=4]~~60.jpg[/attachment]~~[attachment=3]~~61.jpg[/attachment]~~[attachment=2]~~62.jpg[/attachment]~~[attachment=1]~~63.jpg[/attachment]~~[attachment=0]~~64.jpg[/attachment]

Here’s how that post looked in phpBB:

 ![caption](https://global.discourse-cdn.com/meta/original/4X/8/0/a/80aeb76326955a07a61859bc9eab5b797f4f9376.jpeg)

---

<div class="post-metadata">

### Author: ![shortmort37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shortmort37/32/538876_2.png) [@shortmort37](https://meta.discourse.org/u/shortmort37)
#### Post date: [January 19, 2026, 10:49pm UTC](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476/40 "2026-01-19T22:49:48Z")

</div>

Somehow I hosed my Docker instance for my test environment. I’m in the process of reinstantiating it.

Instead of modifying the import script, I’m going to take a snapshot and post-process with a script that will take an extract of attach\_ids, filenames and comments and attempt to add as captions to images (with a little help from Claude). I’m not too optimistic, but I’ll let folks know how it works out.

Regarding those warnings about bad date/time values, this from Claude:

> The warning is coming from the EXIFR gem, which reads EXIF data from image files (your attachments). It’s not about post dates at all - it’s about metadata in the image files themselves.
> 
> The warning appears when processing attachments with invalid EXIF date/time metadata. This is cosmetic and won’t affect your import.

Which is as you thought, @pfaffman . But I’m glad to know now the trigger for the warning.

[Previous page](https://meta.discourse.org/t/enhancement-request-to-phpbb3-import-script/393476.md?page=1)
