Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Ghost 2.0 #156

Open
nvanvi opened this issue Aug 22, 2018 · 24 comments
Open

Upgrade to Ghost 2.0 #156

nvanvi opened this issue Aug 22, 2018 · 24 comments

Comments

@nvanvi
Copy link

nvanvi commented Aug 22, 2018

Please upgrade to Ghost 2.0
Thank you.

@mars
Copy link
Collaborator

mars commented Aug 22, 2018

Did you try upgrading it locally with npm install ghost@2.x?

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

@AlvaroR156
Copy link

AlvaroR156 commented Aug 22, 2018

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?

@mankwok
Copy link

mankwok commented Aug 22, 2018

@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", ...}

@octave
Copy link
Contributor

octave commented Aug 25, 2018

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

@Prozi
Copy link

Prozi commented Aug 25, 2018

I didnt, and you're right about the casper

@Prozi
Copy link

Prozi commented Aug 25, 2018

and it works

@Prozi
Copy link

Prozi commented Aug 25, 2018

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

where ncu is npm check updates

@mankwok
Copy link

mankwok commented Aug 29, 2018

@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.

@mrneilypops
Copy link

mrneilypops commented Sep 1, 2018

I was unable to upgrade with npm install ghost@2.x
I was able to upgrade with ncu -a
screenshot from 2018-09-01 15-56-24

@heruan
Copy link

heruan commented Sep 9, 2018

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.

@mars
Copy link
Collaborator

mars commented Sep 10, 2018

@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 🙏

@Prozi
Copy link

Prozi commented Sep 10, 2018

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"
  },

@mars
Copy link
Collaborator

mars commented Sep 15, 2018

@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.

@eiknarr
Copy link

eiknarr commented Oct 10, 2018

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 ghost@2.x but to no avail.
N.B. 2 There is a yarn.lock file in my Ghost directory.

@kirylrb
Copy link

kirylrb commented Oct 11, 2018

@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"
  }
}

@eiknarr
Copy link

eiknarr commented Oct 11, 2018

@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.

@blaze33
Copy link
Contributor

blaze33 commented Nov 15, 2018

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!

@360art
Copy link

360art commented Nov 17, 2018

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

@LimeBlast
Copy link

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.

@lehung121
Copy link

Did you try upgrading it locally with npm install ghost@2.x?

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 ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed" How to fix it ?

@SNathJr
Copy link

SNathJr commented Jan 6, 2019

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.

@kevinyun
Copy link

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

@kichappa
Copy link

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 ghost@2.x 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?

@RotBolt
Copy link

RotBolt commented Jun 7, 2019

for upgrading, Do I have to fork this repo and run npm install ghost@2.x inside this repo ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests