ghost-on-heroku icon indicating copy to clipboard operation
ghost-on-heroku copied to clipboard

Upgrade to Ghost 2.0

Open nvanvi opened this issue 5 years ago • 24 comments

Please upgrade to Ghost 2.0 Thank you.

nvanvi avatar Aug 22 '18 03:08 nvanvi

Did you try upgrading it locally with npm install [email protected]?

Does it deploy successfully? Please let us know your findings. Feel free to open a Pull Request for the upgrade.

mars avatar Aug 22 '18 05:08 mars

I did the update following @mars command and everything is working fine. The only thing that I can mention is that a bunch of posts were created and published, so make sure to remove them before pushing to Heroku. I have a question, will automatically keep updating ghost to the latest version with every push?

AlvaroR156 avatar Aug 22 '18 10:08 AlvaroR156

@mars I tried upgrading to v2.0.3. Everything works fine such as uploading images to S3 and sending emails.

Oh. Be sure to upgrade the Casper theme to v2.5.1, otherwise, the post images will be over-sized. "dependencies": { "casper": "github:tryghost/Casper#2.5.1", ...}

mankwok avatar Aug 22 '18 14:08 mankwok

Did you guys have to create /app/content/settings/routes.yaml too?

octave avatar Aug 25 '18 16:08 octave

I didnt, and you're right about the casper

Prozi avatar Aug 25 '18 19:08 Prozi

and it works

Prozi avatar Aug 25 '18 19:08 Prozi

actually I just did ncu -a && yarn install github:tryghost/Casper#2.5.1 --save

where ncu is npm check updates

Prozi avatar Aug 25 '18 19:08 Prozi

@octave I checked that routes.yaml will be created in V2 automatically. And if you have a custom one, you probably need to commit it to Heroku master.

mankwok avatar Aug 29 '18 15:08 mankwok

I was unable to upgrade with npm install [email protected] I was able to upgrade with ncu -a screenshot from 2018-09-01 15-56-24

mrneilypops avatar Sep 01 '18 13:09 mrneilypops

I'm still not able to start Ghost 2.1.1 on Heroku. How should I specify host and ports? They should be an enviroment variable but in Ghost 2 the config is JSON which AFAIK does not support variables.

heruan avatar Sep 09 '18 19:09 heruan

@heruan this Heroku app generates the config JSON when it starts up with this Node script.

It’s interesting that noone else has reported that problem yet, but if the config does need to be tweaked, feel free to figure it out and open a pull request 🙏

mars avatar Sep 10 '18 06:09 mars

worked for me but I did it myself

my relevant dependencies

  "dependencies": {
    "@babel/core": "^7.0.0",
    "casper": "github:tryghost/Casper#2.5.1",
    "express": "^4.16.3",
    "ghost": "^2.1.0",
    "ghost-storage-adapter-s3": "^2.5.2",
    "path": "^0.12.7",
    "webpack": "^4.17.1",
    "webpack-command": "^0.4.1"
  },

Prozi avatar Sep 10 '18 20:09 Prozi

@AlvaroR156 it will not automatically upgrade on each deploy, unless you delete the package-lock.json file and set the dependency version for Ghost in package.json to a range such as "2.1.x". Deleting the lock file is not advised. It exists to prevent unexpected changes the could break the deployment or make it impossible to reproduce the same dependency combination on two different computers.

mars avatar Sep 15 '18 15:09 mars

Hi all. Heroku is consistently throwing 503 or application errors after the attempted upgrade to 2.x. The steps I followed (adapted from this thread and a how-to) are in this Gist.

I've tried to piece together everything I can have tried this dozens of time, learning a bit along the way but I've hit a firm road block. Any help would be appreciated. Thank you!

N.B. I tried npm install [email protected] but to no avail. N.B. 2 There is a yarn.lock file in my Ghost directory.

eiknarr avatar Oct 10 '18 18:10 eiknarr

@eiknarr Try to remove package-lock.json and make npm update with relevant package.json below. Also make sure you have ClearDB and Mailgun extensions on heroku. It works for me on clear installation, for which I imported previously exported content.

{
  "name": "ghost-on-heroku",
  "description": "Just a blogging platform on Heroku.",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git://github.com/cobyism/ghost-on-heroku.git"
  },
  "bugs": "https://github.com/TryGhost/Ghost/issues",
  "private": true,
  "version": "1.7.1",
  "dependencies": {
    "casper": "github:tryghost/Casper#2.6.4",
    "ghost": "^2.2.2",
    "ghost-storage-adapter-s3": "^2.5.2",
    "mysql": "^2.16.0",
    "@babel/core": "^7.0.0",
    "express": "^4.16.3",
    "path": "^0.12.7",
    "webpack": "^4.17.1",
    "webpack-command": "^0.4.1"
  },
  "engines": {
    "node": "8.9.x"
  },
  "scripts": {
    "start": "node server.js"
  }
}

kirylrb avatar Oct 11 '18 11:10 kirylrb

@kirylpl That worked! Thank you, very much.

The one caveat was that I did not have a package-lock.json file, but a yarn.lock file (having used ncu -a && yarn add github:tryghost/Casper#2.6.4 --save). Updating the dependencies and removing yarn.lock did the trick.

I've updated my Gist with the steps that worked. Thanks to everyone in this thread and Andrew at InitialApps for the help.

eiknarr avatar Oct 11 '18 14:10 eiknarr

In my case I had to follow these steps:

  1. upgrate to the latest 1.x release
  2. upgrade to the first 2.0.0 release
  3. create a content/settings/routes.yaml file (default content in ghost doc) even if some said it was created automatically for them. So , YMMV
  4. finally upgrade to the latest 2.x release

Hope it helps. Take care!

blaze33 avatar Nov 15 '18 20:11 blaze33

I have directly upgraded to newest version via package.json (ghost and theme). Everything is working good.

360art avatar Nov 17 '18 13:11 360art

I managed to update to Ghost 2 using the the steps outlined above, but found it didn't run correctly when pushing to my existing app on Heroku.

To combat this, I started a new app, deployed to this, set it up with a new database, then used the export/import tools to bring my content across.

The issue I was having had something to do with migrations failing, which might have been my fault from previous botched attempts to update, so a fresh start with a new database seems to resolve these issues.

For what it's worth, my repo is here: https://github.com/LimeBlast/maker.limeblast.co.uk - no idea if it contains anything useful for anyone else.

LimeBlast avatar Nov 21 '18 10:11 LimeBlast

Did you try upgrading it locally with npm install [email protected]?

Does it deploy successfully? Please let us know your findings. Feel free to open a Pull Request for the upgrade.

I got this error "npm WARN [email protected] requires a peer of ajv@^5.0.0 but none is installed" How to fix it ?

lehung121 avatar Dec 09 '18 13:12 lehung121

Might I suggest checking out a repository I have made by forking cobyism's ghost-on-heroku. I have updated it to ghost 2.9.1. You can find it on github here (scroll down to the readme section for a deploy button). Or if you prefer a webpage with a quick deploy button, you can go to this page. I also added a cloudinary adapter for image and video CDN. It also has a few free themes preinstalled.

SNathJr avatar Jan 06 '19 20:01 SNathJr

@SNathJr thanks! I was getting the DB migration fail issues, but your repo saved the day and many hours

kevinyun avatar Jan 30 '19 00:01 kevinyun

Hi @SNathJr, the deploy button method gives an error because of the existence of both package-lock.json and yarn.lock.

@mars I tried npm install [email protected] and it ran successfully. Unfortunately, ghost now believes that its URL is localhost:2368. I can't find a way to fix this. Any suggestions?

kichappa avatar May 25 '19 05:05 kichappa

for upgrading, Do I have to fork this repo and run npm install [email protected] inside this repo ?

RotBolt avatar Jun 07 '19 00:06 RotBolt