Enhancement request to phpBB3 import script

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

Sorry, I should have anticipated these checks.

Try running the drop command with this env variable:

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

su discourse
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop

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.

Still no love.

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…

1 Like

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:

    git config --global --add safe.directory /var/www/discourse

rake aborted!

Forget my first instructions :smiling_face_with_tear:

  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.

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

1 Like

In fact, it’s gonna take…

200

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

1 Like

Finished.

Done.

Complete. Ready to run the import script, but…

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

I blew this :index_pointing_up: away, didn’t I.

1 Like

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.

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. 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.

1 Like

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.

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.

Thanks! I will post back here. BTW, now that I’m a docker cp expert :zany_face: , 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