Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade postgres docker compose #749

Merged

Conversation

Adito5393
Copy link
Contributor

Description

This PR includes the following changes:

  • Upgraded the DB to the latest stable alpine version. The version is pinned with MAJOR.MINOR (15.2), but can be changed to MAJOR (15) only if desired.
  • Updated the health check command to use environment variables instead of a hard-coded value.
  • Added the timezone environment variable TZ to the DB.

Testing

The changes were tested on a VM server using the docker compose stacks.

@mgogoulos
Copy link
Contributor

Looks good, however I'm wondering whether it needs anything for installations that are currently using PG 13. Do they require some sort of migration, or this is happening transparently between versions 13 and 15?

@mgogoulos
Copy link
Contributor

I just tried that on an installation that was having MediaCMS running through Docker, with PG 13. It does not run, and the message is this:

db_1              | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1              | 
db_1              | 2023-06-27 11:07:42.959 UTC [1] FATAL:  database files are incompatible with server
db_1              | 2023-06-27 11:07:42.959 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 15.2.

So although new installations will work fine with this, it cannot be merged since it will break existing installations ;(

@mgogoulos
Copy link
Contributor

If this is something that cannot be fixed automatically, at least a complete migration path should be included, with ready to run instructions for exporting/deleting/importing data...

@Adito5393
Copy link
Contributor Author

Indeed, running the DB inside the docker container does not mean that pgupgrade is useless. All users who self-host services, sooner or later learn how to migrate DB depending on which DB they favor.

There are lots of guides on PostgreSQL:

I think MediaCMS should not recommend users to blindly use the available docker-compose files but offer them as examples on how to initially setup. Most people who use docker will not even git clone the repo & just handy pick the file(s) needed.
I only needed to overwrite the deploy/docker/local_settings.py

@mgogoulos
Copy link
Contributor

Merging, will now add notes on the docs on how to update - https://github.com/mediacms-io/mediacms/blob/main/docs/admins_docs.md

@mgogoulos mgogoulos merged commit 487e098 into mediacms-io:main Jul 3, 2023
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.

None yet

2 participants