Upgrading my theme
Command to transfer the file to Skyleafdesign.com
scp ./valkyrie.zip my_host_:/home/my_user_/
I got this error after doing apt-get update
followed by apt-get upgrade
:
![](https://blog.skyleafdesign.com/content/images/2021/05/E27DDC9E-AA1B-404D-BF84-D937755B0967.png)
- didn’t cause any problems
Commands to upgrade the theme
sudo chown -R ghost:ghost ./my_theme
sudo find ./my_theme -type d | sudo xargs chmod 755
sudo find ./my_theme -type d | sudo xargs chmod 644
ghost start gave the following error:
![](https://blog.skyleafdesign.com/content/images/2021/05/57CE2743-1D4F-40FD-9AAC-E832C8D9C42F.png)
Command to fix file permissions
sudo find ./ ! -path "./versions/*" -type f -exec chmod 664 {} \;
Good to go after that:
![](https://blog.skyleafdesign.com/content/images/2021/05/35BE5543-7002-4C1E-A087-EF3D674CD6F0.png)
Upgrading to Ghost 4.0
Reference: https://ghost.org/docs/update/
Command to upgrade Ghost
ghost update
Oh no! I need to upgrade Node to get Ghost:
![](https://blog.skyleafdesign.com/content/images/2021/05/75F2B33C-FDC6-4F95-8FE1-7AA3AF20EE3E.png)
Recommended version:
![](https://blog.skyleafdesign.com/content/images/2021/05/CD82FF8B-BD04-47A4-97D1-87FF109B62C9.png)
Commands to install Node
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt-get install nodejs
- the above Nodesource script will create a file in /etc/apt/sources.list.d/nodesource that should contain the version you specified
But there’s a compatibility issue, since my Ghost version is too old to work with the new NodeJS version:
![](https://blog.skyleafdesign.com/content/images/2021/05/7333F0AF-2523-4D40-938A-227B8A2068C3.png)
You have to upgrade Node to 12 first, and then upgrade to Ghost V4, and then to Node 14 if you still want it.
After installing Node v14, apt-get wouldn’t downgrade it—the only choice was to sledge-hammer it and reinstall:
sudo apt-get remove nodejs
sudo apt-get install nodejs
Then you have to upgrade the command-line client!
![](https://blog.skyleafdesign.com/content/images/2021/05/31BF59EE-5CC8-4F55-AAA7-3DD2B79E844A.png)
Now npm is broken:
![](https://blog.skyleafdesign.com/content/images/2021/05/57477B34-0675-4056-A2EA-FE9FBE065BBA.png)
Reference: https://askubuntu.com/questions/1189230/what-is-the-location-of-node-modules
Command to delete all node modules
sudo rm -rf /usr/local/lib/node_modules/
sudo npm install -g npm
It couldn’t find the ghost command in my $PATH, so I had to kill the SSH connection, and then log back in:
![](https://blog.skyleafdesign.com/content/images/2021/05/B5F66AA5-5DB4-480A-B2E8-221F1C75DFBB.png)
Ghost won’t let you upgrade directly from v3 to v4; you need to upgrade the v3 version first, and then jump to v4 afterwards:
![](https://blog.skyleafdesign.com/content/images/2021/05/4189B4E1-18AA-47B4-8A1A-9FCDF469DDA6.png)
Staggered upgrade commands
ghost update v3
ghost start
… but it just hung here for a long time
![](https://blog.skyleafdesign.com/content/images/2021/05/2BB82E1F-E3E7-4CBA-886D-8F5900CDBCCB.png)
- persisted after a reboot
Attempting the upgrade anyway
![](https://blog.skyleafdesign.com/content/images/2021/05/1580DD46-7CAE-4E60-B44D-02C9FFFCCAEA.png)
Tying up loose ends
Ghost command still hangs
Fix here: https://forum.ghost.org/t/problems-starting-ghost-2-25-1-on-debian-9-9/7912/8
![](https://blog.skyleafdesign.com/content/images/2021/05/3A7FB607-4068-4221-B52D-7C698DBFDB49.png)
Modify the systemD unit to point to the new Node install:
![](https://blog.skyleafdesign.com/content/images/2021/05/B58D5D0F-6D60-49A5-87BA-76641D2CAA3A.png)
Commands to edit the systemd service
sudo vim /etc/systemd/system/ghost_blog.service
sudo systemctl daemon-reload
SONIC BOOM YOU WIN!
![](https://blog.skyleafdesign.com/content/images/2021/05/D23C086C-3C9E-44AF-B40B-F743C2E895D7.png)