[4.x]: Craft CMS does not support backtracking to this version. Please update to Craft CMS 4.5.4 or later.
What happened?
2 days ago, I updated the CMS version to the latest version on the dashboard screen. When the update was completed, no problems were found. The problem seems to have started appearing 11 hours ago. Currently, the dashboard page cannot be accessed and the API call is failing on the front end as well. Please let me know the solution. Thanks in advance.
Craft CMS version
4.5.5
PHP version
8.2.10
Operating system and version
heroku
Database type and version
mysql
Image driver and version
No response
Installed plugins and versions
-
Look in ur composer.json and change the craft version to the last version and do composer update
The cms version of composer.json is 4.5.5, and the composer update has also been completed. However, the error was not resolved.
Try rm -rf vendor/ && rm composer.lock && composer clear-cache && composer update
I just ran the above command. The problem is not yet resolved.
I just discovered one more problem. After executing all version update commands, when I reconnect to the server and check, the version of craft is still displayed as 4.4.13. [craft 4.4.13 => 4.5.5 (CRITICAL)] After executing the cms update command, the above line is not displayed, but if I check it again after some time, it is displayed. What's the problem?
The database backup fails when I try to update the CMS version using the php command. Will this affect the CMS version update?
After executing the command as shown in the image, craft will not be displayed in the updateable list.
When I reconnect after about 10 minutes and run the php command, craft is displayed in the updateable list.
If I check the schema version of the database, the version is still 4.5.4.
I have a question.
$storedSchemaVersion = 4.5.3.0 I don't know how to work this code Craft::$app->schemaVersion Perhaps Craft::$app->schemaVersion is less than $storedSchemaVersion. So my dashboard screen looks like this.
Please share how to properly update craft cms version. Thanks
You could try craft cli by using this command craft migrate --type=app
The command cannot be executed.
Because our website had stopped working, I changed the version and schemaversion in the database's info table to the old version. As a result, the website is now operational and the dashboard screen can be accessed. However, the version of our craft cms is still 4.4.13. Also, we cannot back up the database from the dashboard screen due to an error. Please share how to update cms version to 4.5.5 without problem. Thanks.
php craft migrate --type=app
@jawadharaba98 Thank you for the quick reply. But that doesn't work either.
As the docs say u can also use php craft update --migrate to run new database migrations
https://craftcms.com/docs/4.x/console-commands.html#update
Even if I run this command, the database backup will fail.
The database was downloaded manually using phpmyadmin. Please share how to update craft cms without problems.
php craft update craft If I run the above command, it will say that the version update has been completed, but after some time, it will return to its original state and the version will be 4.4.13. Then, we cannot access the dashboard, the website stops working.
@CoolDevMan It sounds like maybe this is a load-balanced environment, and you’re only updating one of the servers, but not all of them. Or the servers are ephemeral and reverting to the previous deployed state after some time.
Look into how the site is hosted, and how it is supposed to be deployed. Typically you should be running Craft updates locally, committing the updated composer.json + composer.lock + config/project/* files to your Git repository, and letting an automated deployment pipeline handle actually pushing the changes to your server(s).
@brandonkelly Thanks for your letting me know. So, should I change composer.json in the local environment, run composer update, and then upload the changed composer.json + composer.lock + config/project/* files to the server? What should I do on the server? Can I run the php craft update craft command? In fact, the local environment is not currently established. And the mysql database is on amazonaws.com.
@brandonkelly Thank you. I changed the composer.json and deleted the composer.lock file and the vendor folder, and ran the composer install command on my locally. After uploading the updated composer.lock file to the Heroku server, I updated the CMS on the Craft Dashboard. As a result, the Craft dashboard and the website are fully functional.
@brandonkelly @thupsi @jawadharaba98 Thanks to all of you for your advice.