How to Upgrade From Ghost 0.11.x to Ghost 1.0


Post cover image
Photo by John O'Nolan on Unsplash

If you are upgrading from Ghost 0.11.x or any previous version, here are the steps you need to move to the new Ghost 1.0.

We will start with DigitalOcean instructions, and then move on to general Ubuntu instructions.

DigitalOcean

  1. SSH into your DigitalOcean droplet:

    ssh [username]@[your_url.com]
    
  2. In a browser, go to [yourblog].com/ghost/settings/labs/ and log in:

    Click on the 'Export' button and download your post data to your computer.

    export button

    You can also take a snapshot of your droplet if you would like in the DigitalOcean admin.

  3. Back in your SSH shell, stop ghost:

    service ghost stop
    
  4. Now to start the install the new Ghost 1.0, cd into /var/www:

    cd /var/www
    
  5. Rename the existing Ghost folder and make a new one:

    sudo mv ghost ghost-old
    sudo mkdir ghost
    
  6. Install Ghost-CLI:

    sudo npm install -g ghost-cli
    
  7. Set permissions of new Ghost folder to the ghost user and move into it:

    sudo chown -R ghost:ghost ghost/
    cd ghost/
    
  8. Grab MySql password:

    cat /root/.digitalocean_password
    

    Copy the password that it shows for root_mysql_pass

  9. Install Ghost:

    ghost install
    

    If you get an error saying you don't have the right version of node, do the following 2 commands then try again:

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
  10. Answer the questions it prompts with. Here are what we would use or suggestions for you to use:

    blog url: [your full url]
    MySQL Hostname: localhost
    MySQL Username: root
    MySQL Password: [password you copied from last step]
    Database Name: [can be anything, but the name of your blog makes most sense. Aka: ghostforbeginners]
    Setup Nginx: no
    Setup Ghost MySQL User: yes
    Setup Ghost System User: yes
    Setup systemd: yes
    Start Ghost: yes
    

    example install

    only used localhost:2368 as site name in the image because this was a test and not our actual site

  11. The CLI will now have setup and started up Ghost for you.

  12. Now we just need to move your content [posts, images, theme]. Lets start with moving your posts:

    Go to yoursite.com/ghost and create your main user that is the same as your old main user.

    Go to Settings -> Labs and then import the file that you downloaded from your old instance earlier

  13. Now all your posts and users should be imported. Now lets do the images. Back in your shell:

    sudo cp -R ../ghost-old/content/images/* content/images/.
    sudo chown -R ghost:ghost ./*
    
  14. Now, all your posts and images are in the new Ghost install. The last thing to do is add your theme.

    Note on themes: There are breaking changes moving to 1.0 for your theme. You need to check that your theme is compatible before uploading or moving it over to your 1.0 install. Check your theme at https://gscan.ghost.org. For a list of the breaking changes, check out the theme changelog.

    The easiest way to add your theme is to just upload your theme through yoursite.com/ghost/#/settings/design. But, if for some reason, you can't upload it that way, you can also just copy it over from your old install:

    sudo cp -R ../ghost-old/content/themes/[theme_name] content/themes/.
    sudo chown -R ghost:ghost ./*
    
  15. Restart Ghost:

    ghost restart
    
  16. Your done!! You have now moved everything you need over to 1.0 and are good to go!

General Ubuntu Upgrade (other OS's not officially supported anymore)

This is a general guide that should get you through most setups, but since every setup is different, you may need extra steps or changes. This should cover 99% of upgrades though.

  1. SSH into your server hosting Ghost:

    ssh [username]@[your_url.com]
    
  2. In a browser, go to [yourblog].com/ghost/settings/labs/ and log in:

    Click on the 'Export' button and download your post data to your computer.

    export button

  3. Back in your SSH shell, stop ghost.

    service ghost stop
    

    or

    forever ghost stop
    

    or

    pm2 stop all
    
  4. Now to start the install the new Ghost 1.0, cd into /var/www or wherever you have Ghost already living:

    cd /var/www
    
  5. Rename the existing Ghost folder and make a new one:

    sudo mv ghost ghost-old
    sudo mkdir ghost
    
  6. Install Ghost-CLI and MySQL:

    sudo npm install -g ghost-cli
    sudo apt-get install mysql-server
    

    remember the password you just set for the MySQL root user

  7. Set permissions of new Ghost folder to the ghost user (or whatever user you use) and move into it:

    sudo chown -R ghost:ghost ghost/
    cd ghost/
    
  8. Install Ghost:

    ghost install
    

    If you get an error saying you don't have the right version of node, do the following 2 commands then try again:

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
  9. Answer the questions it prompts with. Here are what we would use or suggestions for you to use, but it completely depends on your environment:

    blog url: [your full url]
    MySQL Hostname: localhost
    MySQL Username: root
    MySQL Password: [password you created when you installed MySQL]
    Database Name: [can be anything, but the name of your blog makes most sense. Aka: ghostforbeginners]
    Setup Nginx: no
    Setup Ghost MySQL User: yes
    Setup Ghost System User: yes
    Setup systemd: yes
    Start Ghost: yes
    

    example install

  10. The CLI will now have setup and started up Ghost for you.

  11. Now we just need to move your content [posts, images, theme]. Lets start with moving your posts:

    Go to yoursite.com/ghost and create your main user that is the same as your old main user.

    Go to Settings -> Labs and then import the file that you downloaded from your old instance earlier

  12. Now all your posts and users should be imported. Now lets do the images. Back in your shell:

    sudo cp -R ../ghost-old/content/images/* content/images/.
    sudo chown -R ghost:ghost ./*
    
  13. Now, all your posts and images are in the new Ghost install. The last thing to do is add your theme.

    Note on themes: There are breaking changes moving to 1.0 for your theme. You need to check that your theme is compatible before uploading or moving it over to your 1.0 install. Check your theme at https://gscan.ghost.org. For a list of the breaking changes, check out the theme changelog.

    The easiest way to add your theme is to just upload your theme through yoursite.com/ghost/#/settings/design. But, if for some reason, you can't upload it that way, you can also just copy it over from your old install.

    sudo cp -R ../ghost-old/content/themes/[theme_name] content/themes/.
    sudo chown -R ghost:ghost ./*
    
  14. Restart Ghost

    ghost restart
    
  15. Your done!! You have now moved everything you need over to 1.0 and are good to go!