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
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…
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/discourserake aborted!
Forget my first instructions ![]()
/shared/backups/default.rm -rf /var/discourse/shared./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.
In fact, it’s gonna take…

It’s done .5GB since I’ve started.
Finished.
Done.
Complete. Ready to run the import script, but…
/var/discourse/shared/standalone/import
├── data
├── mysql
└── settings.yml
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.
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.
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
, 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
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…

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)
@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>'
NVM, my bad. the settings.yml file is hosed. Apologies, it will probably be tomorrow when I get back to this.
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.
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.
OK, the import script is running with the revised .rb files. I’ll report back (yawn) in the morning.
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: