URGENTLY need support for downgrade to v. 4.1.1

The 4.2 version didn’t work for me. I need to downgrade to the previous version as soon as possible.

I got matomo-4.1.1.zip from builds.matomo.org, but after uploading the files and replacing the default config.ini.php with the one I use, I got this error:

Your Matomo codebase is running the old version 4.1.1 and we have detected that your Matomo Database has already been upgraded to the newer version 4.2.0. Maybe your Matomo administrators are currently finishing the upgrade process. Please try again in a few minutes. If you still have this issue please contact your Matomo administrator for assistance. 

What needs to be done in the database in order to work?
I have searched your site, documentation, your github - there is no relevant database info.

Please respond, this has to be fixed.
Should have never done this update.

Hi,

It isn’t really possible in general to downgrade an update after the database migrations have been applied.

You would have to manually first reverse the database migrations that have been applied:
https://github.com/matomo-org/matomo/blob/4.x-dev/core/Updates/4.1.2-b1.php
https://github.com/matomo-org/matomo/blob/4.x-dev/core/Updates/4.1.2-b2.php

In this case it might even work without any changes as I think these changes were only fixing some things and not changing something in a backwards-incompatible way.

And you would need to change the version in the database with something like this:

UPDATE matomo_option set option_value = '4.1.1' where option_value like '4.2%';

Reversing database migrations is beyond my knowledge.

But if I understood your message, is it possible not to do these reverse migration changes, and still run an SQL query for changing matomo version, and it would work?

If I understand it correctly your issue is with https://github.com/matomo-org/matomo/issues/17259.

Wouldn’t in this case be easier to keep the Matomo the same, but replace the matomo.js files with the ones from 4.1 to revert the changes in the performance metrics APIs used?

Sounds a better option if it works. Besides matomo.js what other files should I change?

E.g. the files in matomo/js ?

I’d replace piwik.js, matomo.js and the files in js/

Done. Let’s see how this goes, hopefully monitoring will come back to what it was.

So far there is this error in system diagnostics:

" There are some issues with your system. Matomo will run, but you might experience some minor problems. "

Errors below may be due to a partial or failed upload of Matomo files.
--> Try to reupload all the Matomo files in BINARY mode. <--

File size mismatch: /home4/astro3/public_html/matomo/js/piwik.js (expected length: 303566, found: 303776)
File size mismatch: /home4/astro3/public_html/matomo/js/piwik.min.js (expected length: 61889, found: 61980)

There’s one more problem, with the updating of data. Auto-archive runs normally every hour, yet the data no longer updates regularly. It takes several hours for anything to show up, around half a day or so. Only the ‘latest visitors’ keep working as before.

The archive log shows no errors and neither does the system diagnostic check regarding archiving. I also mentioned it in Github.

Thanks for helping.

Update: All the other problems are also fixed. Now the metrics not only appear properly, they also update every hour, as they should, and visits are no longer missing from the page performance panel. And some unusual server load is also gone and activity is back to normal.

I have two separate sites, very different, and both were badly affected by this 4.2 update. I am not a programmer expert, but this new performance API is NOT READY for live sites and real-world conditions.

Thanks again for the help, it is much appreciated.