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 Joomla with Docker #161

Open
MegaShinySnivy opened this issue Jun 22, 2023 · 11 comments
Open

Upgrade Joomla with Docker #161

MegaShinySnivy opened this issue Jun 22, 2023 · 11 comments

Comments

@MegaShinySnivy
Copy link

A friend and I are running a Joomla blog via docker compose, and were wondering what the proper upgrade steps are. We don't see a good method for upgrading, as even with the latest container, it is still reporting that 4.1.3. is installed. We assume this is because the database was not upgraded with the main server. What is the proper upgrade path, and how do we perform it?

@Llewellynvdm
Copy link
Member

The proper upgrade path is at this time simply updating via the Joomla admin backend area.

There has been work done, that we may in the future introduce a CLI path into the docker upgrade path.

I suppose you have your Joomla files and database setup in a persistent state, and in this case I would normally update Joomla in the admin area as normal, then I would stop the container, and remove the image, update the composer file, and start up the container again. Since the image will not override any files or database that has been linked to your container persistently this will only update the PHP environment, and not really effect Joomla directly.

But yes there is no docker way to update from one version of Joomla to the next at this time.

@jastlw
Copy link

jastlw commented Jun 28, 2023

@Llewellynvdm Thx for your response.

Is there a timetable by when the update will be introduced through the Docker image?
Dockerised wordpress can this since its introduction.

I would like to migrate to dockerised Joomla with update option, but waiting for its support.

@MegaShinySnivy
Copy link
Author

What files need to be persisted? I was aware of the database, what of the actual files in the joomla container?

@wilsonge
Copy link

images directory for sure. Potentially extensions too

@Llewellynvdm
Copy link
Member

Okay so we simple do a check here on line 79 of the entry point that stops the rewrite of the existing "persisted" files. And even if we don't find these core files, we give an warring on line 85 with user input possible to stop the process by press Ctrl+C which will stop the process. We could therefore easy adapt this process on the file level without any major changes needed. Since overwriting the files will be seen as a manual update, and in Joomla there is a discovery feature to fix the database should there be any needed. Further more we can auto delete the installation folder should we detect this is an update.

@richard67
Copy link

@Llewellynvdm The database fixer fixes only the structure but not the data, and we do data changes in updates. Discovery installation will also not solve everything.

@Llewellynvdm
Copy link
Member

@richard67 okay can we use the CLI update to resolve this? I mean is there any way currently to get around these limitations from a CLI stand point? Also if we could focus on only the minor versions, and not step over to major versions... not that that will not also be ideal, but just to get the initial update path in place.

@richard67
Copy link

There are options to check for core updates and if some found to update the core with cli, see e.g. php cli/joomla.php core:update

I’m not an expert on the cli but as far as I know it runs the database updates and some of the necessary steps after that, e.g. migrating the repeatable fields to subforms when updating from 3.10 to 4.

For 5.0 we will have other migrations. If the cli is missing some of that we have to fix that. So all in all cli update should work, but that is of course not docker based.

@Llewellynvdm
Copy link
Member

What do you mean:

but that is of course not docker based.

Docker is CLI and if we have persisted files we can check if the needed 'cli' files exist and trigger any commands just like you can in any command line interface (CLI) since we are in the PHP base image. That means we should be able to update our entry-point script and catch these edge-case behaviour as needed.

@Llewellynvdm
Copy link
Member

I would like to migrate to dockerised Joomla with update option, but waiting for its support.

@MegaShinySnivy, after examining the Wordpress instances, I honestly cannot discern any difference in the implementation. As I previously mentioned, our method involves checking if the core files persist. If they do, we avoid redeploying the update package, which is essentially the same process as what they're doing. Therefore, if you choose not to persist your website's root folder, it would naturally result in a new file set. But in Joomla this will be like a new installation, since the database config file will also be lost, and even if that was the only file to persist, the database would be "un-update" and possible be giving errors.

I've noticed that they possess a completely dedicated set of images for CLI commands. I haven't had the opportunity to work with their tools, so I can't definitively say how it operates. However, I suspect this feature facilitates effortless updates and migration control.

Achieving this without the need for an additional set of images is something we're aiming for, there has been some conversations in the CMS maintenance team, and the current consensus would be to test the CLI for Joomla 4+ as a possible means to achieve this objective.

Let me know if your willing to run some tests, basically using the CLI command to update your system in a docker container. at the same time as updating the docker image. Should you be interested I could pull up some testing images in my private repository and update the entry-point as I mentioned before.

@MegaShinySnivy
Copy link
Author

I can run some tests, sure, though obviously not in production. Give me the details and I'll spin something up.

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

No branches or pull requests

5 participants