Skip to content

Full update between different PHPBB versions#7

Open
jhauschild wants to merge 9 commits into
EvanDarwin:mainfrom
jhauschild:update-path
Open

Full update between different PHPBB versions#7
jhauschild wants to merge 9 commits into
EvanDarwin:mainfrom
jhauschild:update-path

Conversation

@jhauschild
Copy link
Copy Markdown

@jhauschild jhauschild commented May 16, 2026

First of all: thanks for setting this up! I was using your image to upgrade my board, and eventually made it work =)

Given that the next PHPBB 3.3.16 was released , I was wondering about upgrading between different PHPBB versions, and realized that the container did not have a clear, well-defined upgrade strategy.
In fact, I was trying to migrate an existing forum into the docker container. Following the (full update strategy in PHPBB docs)[https://www.phpbb.com/support/docs/en/3.3/ug/upgradeguide/update_full/], I was mounting volumes for the files, images, store, ext, styles and config.php file.
Given that the container has the phpbb files for the current version (or downloads it in the install-phpbb.sh script if not), this should have worked... but it didn't quite:

  1. Initially, I had some permission issues with the files, but a chmod -R 100:101 from within each volume solved it (more below).
  2. For some reason, the mysql:8.0 image you suggested in the docker-compose example just didn't work for me (it had issues with ssl in the container?!?), but switching to mariadb:latest solved that problem. Also, calling mysql from the phpbb container gives a deprecation warning that one should use the mariadb command instead, so migrated to that.
  3. Once permissions were fixed, the docker container still didn't start: to create the config.php, it had to call the install-from-yml.sh script, which in turn failed because the called php install/phpbbcli.php install config.yml expects an empty database.

To address 3., I hence added a update-db-migration.sh script that instead calls php install/phpbbcli.php update update-config.yml
with the config containing just

updater:
   type: db_only

The script is called from the docker-entrypoint.sh if the config.php already exists, assuming that in that case the database and volumes are from a previous installation.
I still call (and extended) the install-phpbb.sh script to populate initially empty subfolder volumes (explicitly checking the 5 folders mentioned above).

Finally, when testing the setup for a fresh installation I also ran into the permission issue with the config.php not being writable for the inital configuration when using a bind mount. The best fix I could find was to add another /opt/phpbb/config folder outside of the phpbb script, and copy just the config.php from there to the phpbb folder on container startup, and back at the end of the install-from-yml.sh script, which is the only time the config.php should be written.

test setup

Eventually, I was testing the setup locally with:

PHPBB_VERSION=3.3.14 ./scripts/build.sh
docker compose up -d
# check http://localhost:8080 is working, register new user and add post to see if changes in database persist
docker compose down
PHPBB_VERSION=3.3.16 ./scripts/build.sh
docker compose up -d 
docker compose logs phpbb    # should show that database migration was done
# check that http://localhost:8080 is working again, and new post ist still there  (although not yet approved, so login required. Note that the login redirects to the SERVER_URL set in initial environment variables)

I copied the docker-compose.yml from the README to a separate file in the repo, which helps to get started, I think.

permission issues caused by build failure

I realized that the images you released don't have the actual PHPBB content in them. Later I saw this discussed in #1 already, but I think it's still not fixed? Maybe the approach with adding the artifacts for specific versions would be good, given that new releases become quite rare these days.
While the docker entry script kind of recovers from that by just downloading the files again, it makes subfolder volume permissions fail: an initially empty volume is populated with the content and permissions of the folder within the image, but if that folder doesn't exist, it just gets root permission, and then the phpbb user can't write to them.
That's why I had to build the images for old versions in the test setup locally as well...

PS: I also noticed that the setup you had was not including the hidden .htaccess files when using mv "phpBB3"/* ${PHPBB_ROOT}/phpbb/ in the Dockerfile. Initially, I was a bit alarmed, until I realized that the .htaccess is not used by nginx anyways. Is there a reason to not include it, though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant