I am very behind on updating my ghost instance and started the process to update from version 3.0.2 (Mysql 5.7.38) to version 5.2.3. While I worked through that update, I had to run ghost update v3 before being able to update to 5.2.3 and along the way updated my node. I have successfully updated to 5.2.3, but when restarting my ghost instance (ghost restart) I received a migration error.
What is strange about this migration error is that it suggests running ghost update v3, which doesnβt make sense because Iβm on 5.2.3. Following the second suggestion, I ran journalctl -u ghost_www-website-com -n 50 and saw a more verbose debug that pointed to the location of knex-migrator error, but no valuable information to work off of. I have seen some similar debug questions in the forum where it might have to do with collation name in the DB, but Iβm not sure if that is the case for me.
Any direction would be helpful!
Error:
Debug Information:
OS: Ubuntu, v18.04.3 LTS
Node Version: v16.15.1
Ghost Version: 5.2.3
Ghost-CLI Version: 1.21.0
Environment: production
Command: 'ghost restart'
Message: Ghost was able to start, but errored during boot with: Unable to run migrations
Help: Run 'ghost update v3' to get the latest v3.x version, then run 'ghost update' to get to the latest.
Suggestion: journalctl -u ghost_www-website-com -n 50
Stack: Error: Ghost was able to start, but errored during boot with: Unable to run migrations
at Server.<anonymous> (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:73:28)
at Object.onceWrapper (node:events:641:28)
at Server.emit (node:events:527:28)
at emitCloseNT (node:net:1728:8)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
journalctl -u ghost_www-website-com -n 50
Unable to run migrations
Jun 28 12:42:08 website-com node[19796]: "You must be on the latest v3.x to update across major versions - https://ghost.org/docs/update/"
Jun 28 12:42:08 website-com node[19796]: "Run 'ghost update v3' to get the latest v3.x version, then run 'ghost update' to get to the latest."
Jun 28 12:42:08 website-com node[19796]: Error ID:
Jun 28 12:42:08 website-com node[19796]: b95aac70-f6df-11ec-9c81-5572693a5f7d
Jun 28 12:42:08 website-com node[19796]: ----------------------------------------
Jun 28 12:42:08 website-com node[19796]: InternalServerError: Unable to run migrations
Jun 28 12:42:08 website-com node[19796]: at /var/www/ghost/versions/5.2.3/node_modules/knex-migrator/lib/index.js:1032:19
Jun 28 12:42:08 website-com node[19796]: at up (/var/www/ghost/versions/5.2.3/core/server/data/migrations/utils/migrations.js:118:19)
Jun 28 12:42:08 website-com node[19796]: at Object.up (/var/www/ghost/versions/5.2.3/core/server/data/migrations/utils/migrations.js:54:19)
Jun 28 12:42:08 website-com node[19796]: at /var/www/ghost/versions/5.2.3/node_modules/knex-migrator/lib/index.js:982:33
Jun 28 12:42:08 website-com node[19796]: at /var/www/ghost/versions/5.2.3/node_modules/knex/lib/execution/transaction.js:221:22
Jun 28 12:42:08 website-com node[19796]: at processTicksAndRejections (node:internal/process/task_queues:96:5)
Originally that was my issue, but I was able to upgrade to MySQL 8 and re-ran hoping to see some success, but left with the same issue and errors at the migration
ghost lsoutputs:
β Name β Location β Version β Status β URL β Port β Process Manager β
ββββββββββββββββββββββββββΌβββββββββββββββββΌββββββββββΌββββββββββΌββββββΌβββββββΌββββββββββββββββββ€
β www-website-com β /var/www/ghost β 5.2.3 β stopped β n/a β n/a β n/a β
ββββββββββββββββββββββββββ΄βββββββββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββ΄βββββββ΄ββββββββββββββββββ
I ranghost doctor:
β Checking system Node.js version - found v16.15.1
β Checking logged in user
β Ensuring user is not logged in as ghost user
β Checking if logged in user is directory owner
β Checking current folder permissions
β Checking system compatibility
β Checking for a MySQL installation
+ sudo systemctl is-active ghost_www-connorphillips-com
β Validating config
β Checking folder permissions
β Checking file permissions
β Checking content folder ownership
β Checking memory availability
β Checking binary dependencies
β Checking free space
β Checking systemd unit file
β Checking systemd node version - found v16.15.1
Thenghost migrate:
ghost migrate
β Checking for available migrations
No migrations needed :)
Finallyghost restart:
+ sudo systemctl is-active ghost_www-website-com
Ghost instance is not running! Starting...
+ sudo systemctl start ghost_www-website-com
+ sudo systemctl stop ghost_www-website-com
β Starting Ghost
A GhostError occurred.
Message: Ghost was able to start, but errored during boot with: Unable to run migrations
Help: Run 'ghost update v3' to get the latest v3.x version, then run 'ghost update' to get to the latest.
Suggestion: journalctl -u ghost_www-website-com -n 50
Debug Information:
OS: Ubuntu, v18.04.3 LTS
Node Version: v16.15.1
Ghost Version: 5.2.3
Ghost-CLI Version: 1.21.0
Environment: production
Command: 'ghost restart'
mysql --version:
mysql Ver 8.0.29 for Linux on x86_64 (MySQL Community Server - GPL)
Iβve started to follow the instructions to update to v3 before updating to v5.
Message: Unable to update Ghost directly to v3.42.9. You must be on the latest v5.x to update across major versions.
Help: Run "ghost update v5" to get the latest v5.x version, then run "ghost update" to get to v3.
It doesnβt make sense that Iβm updating to v5, to update to v3, to update back to v5. Is it possible to install 3.42.9 while keeping 5.x? Or instructions to revert to 3.42.9 before going through the update process again?
Did you roll-back or restore a backup before starting over? If you have a mix of incompatible software versions, youβre going to run into difficulties.
I recommend you roll-back to the working V3 instances, and then follow the upgrade steps from the official documentation previously linked.
Yes I missed that in the documentation and had to start from an old snapshot and was able to bypass this issue. Currently facing migration issues at the last step, but I think that this question has been answered. Thank you!