Upgrading Hexo

I’m using Hexo as my blogging platform (static content generator). Every time I upgrade it I run into some kind of issue. Usually because:

  • I upgrade rarely and I have made some changes into themes etc.
  • I don’t remember how to upgrade hexo and plugins to the latest version with NPM. It seems that one command doesn’t work. Some parts upgrade and some don’t.
  • I forget to delete some temporary files and first time running hexo generate produces invalid results

I decided to document the steps so that I don’t have to google them every time. These steps assume you are using Git to keep your blog content and you are deploying the generated content. If not just ignore everything that talks about branches.

Correct branch

Typically, source branch is where the source of the blog is (markdown files etc.) and master is for generated content. Make sure you are in the source branch.


Before upgrading remove all the files/folders that will be recreated either during npm install or when generating content.

  1. Delete .deploy_git folder
  2. Delete node_modules folder
  3. Delete db.json
  4. Delete public folder

Modify package.json

The package.json should only contain the following:

"hexo": {
"version": ""

Install latest version of hexo-cli

npm install hexo-cli -g

Install Hexo

You should run this in the folder where hexo is installed.

npm install hexo --save

Install plugins

Install the plugins you use.

npm install hexo-server --save
npm install hexo-renderer-ejs --save
npm install hexo-renderer-marked --save
npm install hexo-renderer-stylus --save
npm install hexo-generator-index --save
npm install hexo-generator-feed --save
npm install hexo-generator-sitemap --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save
npm install hexo-deployer-git --save


Generate the content

hexo generate

Start the server

hexo server

After these steps you should have the latest version of hexo and plugins running.

Time to find a new backup service

I’ve been using SOS Online Backup for a while now. It offers unlimited backups for ~$80/year. The best part is that the backup is actually a backup. If I delete a file locally it doesn’t affect the backup. With other services such ad OneDrive or Dropbox the deletions are synced against the cloud. Delete a file locally and usually it gets deleted from the cloud.

Few days ago I received the following email from SOS Online Backup:


The email also said: We have rolled back the unlimited plans for now and are not available any more. If you are interested in your current unlimited storage plan, I suggest you take the 3 year option as you can stay on the same unlimited plan until 06/2019. I think that is really good customer service. Paying $99 for unlimited backups per year is really cheap.

I’ve been very happy with SOS Online Backup. I installed the client on my home server and that’s it. Since the unlimited plan is not available anymore I think it is a good time to look for a new backup service. I have few options on my mind but I’ll have to test the upload speeds and see how easy it is to setup automated backups that run every night.