I updated the Docker images like this:
But, the website threw the 500
error:
I had taken backups of Docker named volumes by this approach: https://stackoverflow.com/a/79247304/3405291
So, I did restore the Docker named volumes. However, the website threw this error:
Error establishing a database connection
The database connection error got fixed. To do so, I deleted everything inside the database volume by rm -rf *
command:
/var/lib/docker/volumes/wordpress_dbdata/_data/
Then I restored the Docker volume of the database.
This screenshot shows the contents of the database volume before deleting/restoring and after:
As can be seen, before deleting everything, there were some extra files. Probably those files were messing around with the database connection.
The update by modifying the version of Docker images didn't work. But backup/restore helped us.