Applied the 5.3.2 patch to our WP site yesterday, and in so doing upgraded the database to 5.6.alpha1. After doing this, multiple components (Contributions, Events, Mailing) became unusable. Trying to access these caused 500 (server) errors. Meanwhile, Civi 5.4.1 dropped, so I replaced the 5.3.2 patched code with 5.4.1 -- but couldn't update the database, because it was still 5.6.alpha1.
"No problem," I thought -- I can restore the WP database from a backup. But the only backup I had was from after the 5.3.2 patch, i.e. in the 5.6.alpha1 state. And as luck would have it, the hosting provider's backup on the server was corrupt and couldn't be restored.
So here's my dilemma. System Status tells me I need to "determine the correct version corresponding to your current database state." Should I try to manually alter the working database so it aligns with the 5.4.1 codebase (and if so, how do I even begin to do that)? Or do I try to reapply the 5.3.2 patch and hope to somehow fix the server errors? Or do I apply a different codebase entirely?
The error message also suggests fixing the file civicrm-version.php -- so I set the 'version' value to '5.4.1' but no luck. I still get this:
Your database is marked with an unexpected version number: 5.6.alpha1. The v5.4.1 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. You may want to revert to the codebase you were using until you resolve this problem. OR if this is a manual install from git, you might want to fix civicrm-version.php file.
How best do I fix this? And since Civi appears to be running okay right now despite having different codebase and database versions, is it possible the database version is somehow misidentified -- that the DB version is really 5.4.1, but identifies itself as 5.6.alpha1? Images (bottom) showthe current DB structure.
As an aside, I've just learned a valuable lesson. Always store a DB backup locally before starting an upgrade, even when two automatic backup systems are running. If I had backed up manually, right now I'd be moving other projects forward instead of trying to remedy this version mismatch on an active production site.