Overview

I have been running Ghost 0.x in an Azure App Service with Windows Server. Now I am wanting to upgrade to Ghost 2.0 (using the Deploy to Azure from here.)

The upgrade path that I chose was to export all the data from my 0.x site and then to import that data into the new 2.x site. These were the three high-level steps:

  1. Export my blogs data: Log in to my LIVE 0.x site > Labs > Export
  2. Upgrade the export file: Run Ghost 1.8.0 locally > Labs > Import then Export
  3. Import my blogs data: Run Ghost 2.x locally > Labs > Import

That second step upgrades the 0.x export format to the 1.8 export format. That was necessary because the 0.x export format is not compatible with the 2.x import.

Step 1: Export my blogs data

Basically click the big blue EXPORT button.

Steps 2 and 3: upgrade and import my blogs data

The exported data from step one is not compatible with Ghost 2.x. We need to upgrade the exported data. We do that by importing the data into Ghost 1.8 and then exporting it. After that, we can import the data into 2.x.

export from 0.x > import to 1.8 > export from 1.8 > import to 2.x

Here is how I did that.

Fork https://github.com/solvsoftware/Ghost-Azure.
This is my fork: https://github.com/shaunluttin/Ghost-Azure-2.x.

Then open a command prompt locally and run a clean instance of Ghost 1.8

git clone git@github.com:shaunluttin/Ghost-Azure-2.x.git
git checkout 1.18.0
git clean -xfd
yarn install 
node db.js
yarn run start

Once Ghost 1.8 is running:

  1. In a browser go to http://localhost:2368/ghost
  2. Create your account (I used the exact settings from current 0.x blog).
  3. The Ghost admin panel will open.
  4. Go to Labs.
  5. First, delete all content (it's boilerplate).
  6. Then, import your Ghost 0.x export file (from Step 1).
  7. There will be some warnings. Decide whether to address them.
  8. Go to http://localhost:2368 to view the result.
  9. Return to http://localhost:2368/ghost/#/settings/labs and export.

You have successfully upgraded your 0.x export file to be compatible with Ghost 2.x.

Now, open a command prompt locally and run a clean instance of Ghost 2.x

git checkout azure
git clean -xfd
yarn install 
node db.js
yarn run start

Repeat the import steps but this time import the 1.8 version of the file.

Step 4: Import your images

Images are not part of the Export feature. I downloaded them from Kudu at https://bigfontblog.scm.azurewebsites.net/DebugConsole/?shell=powershell

cd site/wwwroot/content

At this point simply click the download button.

Then extract the images.zip into the Ghost 2.x content/images directory. I use the -force flat to overwrite the README.md file.

Expand-Archive ~\Downloads\images.zip content\images\ -Force

Deploy

There are many paths to deployment. This was mine in Azure.

  • Deployment > Deployment Slots. Add a slot named Upgrade with settings copied from the existing site.
  • Deployment > Deployment Center. Add Github with Kudu and point it at the azure branch of my fork.

Once deployment completes, go to https://bigfontblog-upgrade.azurewebsites.net to see the result.

Then use FTP to copy the local 2.0 content to the slot. That includes these local files.

/content/data/ghost.db
/content/images/

Here is how to find your App Service's FTP credentials: https://stackoverflow.com/a/54151950/1108891

The final step is to Swap the two deployments slots and then, once the swap completes, to delete the slot named Upgrade. This is how my Deployment slots blade looks after the swap is complete.