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

Upgrading Database when upgrading WP version #274

Closed
falconmick opened this issue Jan 15, 2018 · 5 comments
Closed

Upgrading Database when upgrading WP version #274

falconmick opened this issue Jan 15, 2018 · 5 comments

Comments

@falconmick
Copy link

Hey I am just looking into moving our WP sites into Docker, but I am worried about how I migrate my Databases when we upgrade from 4.9 => 4.9.1 for example.

On occasions I have seen that as a part of the upgrade process WP makes changes to the database. How would I make those happen when I use containers? Does WP detect that the DB version doesn't match the installed version?

Sorry just new-ish to wordpress so I don't know how it's update system works fully.

@falconmick
Copy link
Author

The only resource I have found so far suggest that you upgrade the WP version and then you run the upgrade process inside of WP admin portal afterwards. Is this true?

https://cianallner.com/update-docker-containers/

@flojon
Copy link

flojon commented Jan 18, 2018

If the database needs upgrade you will be notified when you login to the admin control panel and you can run it from there.
Note that currently Wordpress is not updated if you update the container image. Because if the volume already contains an installation of Wordpress it will not be overwritten.
So the update needs to be done from the control panel.
I've made a pull request to change this but not sure if it will be accepted. See #272

@falconmick
Copy link
Author

Oh.. I thought that the docker image would not place the installation into the volume!! That makes no sense at all! In my head I would have the entirety of this image as volatile except the media folder, and then when you make your own image you would add to the volatile container your image! Is this not how it works (new)

@flojon
Copy link

flojon commented Jan 22, 2018

Because of the way Wordpress is structured (or lack thereof...) it would be very hard to accomplish a good separation to volatile and non-volatile... I've seen plugins that put files outside wp-content for example...

@tianon
Copy link
Member

tianon commented Jan 22, 2018

Indeed, this is the best we can do with the way WordPress is intended to be used -- a default stock install will treat the entire installation as the "mutable state", especially for the sake of performing self-updates.

In the case of necessary database updates, WordPress will perform them itself. 👍

@tianon tianon closed this as completed Jan 22, 2018
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

3 participants