21 C
Texas

Migrate word-press site to Ghost instances

As the name of the main subject of the post says this is about deploying a equivalent Ghost instance for a site that have been managed by WordPress.

IMPORTANT – At the writing of this post, this would only work on Ghost version 1.0.0.

Getting Started

Note that through out the document, I will stick to Ubuntu 18.04 OS version.

Step 01 — Install WordPress plugin that allow to back up the existing post metadata

  • http://sitea.com/wp-admin -> plugins -> Add new
  • Search “ghost”
Make sure to “activate” once installed.

Step 02 — Download the Ghost compatible JSON that has got the enough metadata 

  • Tools -> Export to Ghost >
  • Then click “Download Ghost File” and this will save a JSON containing all the metadata that required to spin up the equivalent Ghost instance.

Step 03 — Export Images that are part of the existing WordPress site.

  • This step involves coping all the directory & files that are belongs to WEB site’s root Directory -> wp-content -> uploads. For example /var/www/html/siteA/wp-content/uploads/.
  • To make a copy against all these data, you can use;
    • WInSCP from windows systems / SCP from Linux => SSH service should be running on the server that host the existing wordpress site.
    • FTP file transfer client => FTP service should be running on the server that host the existing wordpress site
    • Or check you cPannel options that probably support this.

Step 04 — Spinning up new Ghost instance. 

Step 05 — Import the downloaded images into Ghost instance

  • First, upload all the downloaded files & folders at step 03 into your new Ghost instances. These data should go under /var/www/ghostName/content/images/
  • Now we need to make some changes to the Json that we downloaded in step02. Replace wp-content/uploads with content/images by executing the following command.
    # sed -i.bak -e ‘s|wp-content\\/uploads|content\\/images|g’ downloadGhostInstance.json
  • Browse http://siteA.com/ghost/settings/labs/ and Click on “Choose File” and select the JSON file that we just updated, and click “Import

Step 06 — Setting up the necessary permissions. 

# chown -R ghost:ghost /var/www/ghost/content/images
That’s it. Now you can restart the Ghost instance and have your WordPress site on Ghost.!
“I hope this has been informative for you”
- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article