Pikiran, Ide, dan Gagasan

Update Ghost 0.11.3 [Openshift]

First. Let me tell you that it is just another update and I wouldn’t explain the new features as they have been explained here in every developer blog post. Just go and read it.

Second. I will also try to explain it briefly as I assume that you have read the other posts I wrote before here and here.

Note

Someone confirmed that this tutorial also worked for updating to the version 0.11.7. Read his comments (potatoefist) below.

Backup

Remember to always do a backup first before doing an upgrade.

  1. Go to your blog dashboard > Labs > then hit the Export button. This will export your settings and your content to a json file that you can import whenever you need it.
  2. Make a snapshot of your cartridge by using this command in your terminal rhc snapshot save . You can read about this here.

Pre Update

Please make sure you have installed the right version of node.js in your machine, just take a look at this post for the compabilities. I use 4.2 as this is the recommended one and the version of Node that they use with Ghost in production on Ghost(Pro).

Type node -v to show the version.

Then tidy up your application to prevent a Not Enough Space error. Just run this command on your terminal.

rhc app tidy   

Update

In order to the new Node.js support and a few dependency updates, you should modify your package.json file in your root app folder. I have changed the node version and added the newest dependencies update. You may choose whatever you want. Here is mine:

{
    "name": "openshift-ghost-quickstart",
    "description" : "Openshift Ghost Quickstart (SQLite)",
    "repository": {
        "type": "git",
        "url": "git://github.com/openshift/openshift-ghost-quickstart.git"
    },
    "bugs": "https://github.com/openshift/openshift-ghost-quickstart/issues",
    "main": "index.js",
    "scripts": {
        "start": "node index"
    },
    "engines": {
        "node": "~4.2.0",
        "iojs": "~1.2.0"
    },
    "dependencies": {
        "express": "^4.14.0",
        "ghost": "^0.11.3",
        "amperize": "0.3.1",
        "archiver": "1.1.0",
        "bcryptjs": "2.3.0",
        "bluebird": "3.4.6",
        "body-parser": "1.15.2",
        "bookshelf": "0.10.2",
        "chalk": "1.1.3",
        "cheerio": "0.22.0",
        "compression": "1.6.2",
        "connect-slashes": "1.3.1",
        "cookie-session": "1.2.0",
        "cors": "2.8.1",
        "csv-parser": "1.11.0",
        "downsize": "0.0.8",
        "express-hbs": "1.0.3",
        "extract-zip-fork": "1.5.1",
        "fs-extra": "0.30.0",
        "ghost-gql": "0.0.5",
        "glob": "5.0.15",
        "gscan": "0.0.15",
        "html-to-text": "2.1.3",
        "image-size": "0.5.0",
        "intl": "1.2.5",
        "intl-messageformat": "1.3.0",
        "jsonpath": "0.2.7",
        "knex": "0.12.5",
        "lodash": "4.16.4",
        "moment": "2.15.2",
        "moment-timezone": "0.5.7",
        "morgan": "1.7.0",
        "multer": "1.2.0",
        "netjet": "1.1.3",
        "node-uuid": "1.4.7",
        "nodemailer": "0.7.1",
        "oauth2orize": "1.5.1",
        "passport": "0.3.2",
        "passport-http-bearer": "1.0.1",
        "passport-oauth2-client-password": "0.1.2",
        "path-match": "1.2.4",
        "rss": "1.2.1",
        "sanitize-html": "1.13.0",
        "semver": "5.3.0",
        "showdown-ghost": "0.3.6",
        "sqlite3": "3.1.8",
        "superagent": "2.3.0",
        "unidecode": "0.1.8",
        "validator": "5.7.0",
        "xml": "1.0.1"
    }
}

Save it.

Then remove node_modules folder, clean the node packages cache:

rm -rf node\_modules && npm cache clear  

Then reinstall the packages:

npm install --production  

Push your changes

git add .  
git commit -m "Update to Ghost 0.11.3"  
git push  

Voila !

8 responses to “Update Ghost 0.11.3 [Openshift]”

  1. Tomas Kupka Avatar
    Tomas Kupka

    Thank you, I will give it a try!

  2. marcoib Avatar
    marcoib

    This is the best available guide ANYWHERE!
    Thank you!

    1. Sasono Avatar
      Sasono

      Great to hear it.

  3. Amir Deljuyi Avatar
    Amir Deljuyi

    openshift-quickstart used node v 0.10 how upgrade my node version to 4.2
    Thank you

  4. potatoefist Avatar
    potatoefist

    Is this good from the hosted 0.7.5 to 0.11.7?

    1. Sasono Avatar
      Sasono

      Sure you can directly update your blog.

      1. potatoefist Avatar
        potatoefist

        I can confirm this worked. Went from 0.7.5 to 0.11.7. I only ran into a problem in my json file. I had quotes that didn’t work well and had to copy good ones from elsewhere in the document. Thanks again. This was a really great thing to have.

  5. Deploying The Latest Ghost on Openshift – Noreta Agus Sasono

    […] Openshift doesn’t provide you neither the recommended Node.js nor the required version to install latest stable Ghost on their server and it will cause problems if you update your recent Ghost app. The last known version you can is Ghost 0.11.7. You can read the comments from potatoefist on this post. […]

Leave a Reply

Your email address will not be published. Required fields are marked *