Jump to content

Upgrade process, database changes, schema updates - how does it work?

Recommended Posts

As part of a move to a new hosting provider, I've upgraded from 2.4.0 to 2.5.3, following the instructions and everything worked perfectly.

I couldn't find anywhere the details of how PW knows to make schema changes during upgrades. 

I'm guessing that there's code somewhere that checks on every page load and calls a routine to make the changes needed for the new version?  And that there's an indication in the DB somewhere indicating which version of PW it's been upgraded to?

Thought it might be useful to post this question to get it documented for others.

Since I'm going to be periodically re-importing the old 2.4.0 database underneath the new 2.5.3 code until "new version go-live", I assume it will make these schema changes each time I do that and subsequently load a page?

  • Like 1

Share this post

Link to post
Share on other sites

Hi there

Updates are handled through a module called SystemUpdater in /wire/core/modules/SystemUpdater/ . This folder also holds all the update files that exist so far.

The module has an entry in the modules table in the database that stores the system version so yes, those updates will be reapplied to the database every time you re-import the old database and upgrade.

  • Like 2

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...