神刀安全网

How I Moved My Blog From WordPress to Cosmic JS

Tony Spiro

In this post I will tell you how I migrated my blog content from WordPress to its new happy cloud-content-powered home on Cosmic JS .

Export from WordPress

The first step I had to take was to export the data out of my old blog.  Since Cosmic JS makes it super easy to import data into a bucket, all I had to do was find a WordPress plugin that exports WordPress data into a JSON file that is properly formatted to import into a Cosmic JS bucket.  Luckily such a plugin exists :) https://github.com/cosmicjs/cosmicjs-wp-export .  After installing the plugin, all I had to do was select which post types I wanted to export then click export.  This gave me one JSON file with all of the data I needed to perform the migration into Cosmic JS.

Import into Cosmic JS

The next step was importing the data into Cosmic JS.  To import into a new bucket, I created a new bucket and navigated to Bucket > Settings > Import / Export Data.  Then I just dragged the JSON file that I exported from WP onto the page and within seconds my data (AND FILES!) were imported into my bucket.  (Plugins are not imported)

Build the new blog app

My next task was to build a new blog app.  The app I chose was the Future Imperfect app available on the Cosmic JS Apps page .  It has a sleek, modern front end (designed by @n33co at HTML5UP.net ) and is been build on top of a light-weight Node.js server (goodbye PHP!).  I forked the Future Imperfect app from the GitHub repo and edited it to suite my needs.   The Cosmic JS NPM module made it easy to pull the content in from the Cosmic JS API into it’s new JavaScript backend.  The mustache templates (Hogan) became the perfect compliment with the name-spaced object properties provided by the Cosmic JS JavaScript client, for example:  {{ cosmic.object.nav.metafield.site-title.value }}, how easy is that?!?

Deploy!

The next and final step was to deploy the application for the world to see and marvel!  I decided to deploy my new blog app using the deploy feature in my Cosmic JS bucket.  The path to do so is Bucket > Settings > Deploy Web App.  It was really easy to add the public GitHub url for my new blog and click Deploy!  Within a few minutes my new blog was deployed and out in the world.

With this new simple Node.js / Cosmic JS setup my blog is now much faster and performs much better on page speed tests.  This is because my blog now runs on a light server / CMS API stack rather that a heavy stack of installed applications and plugins.

I hope you’ve enjoyed my story of how I freed my content from the confines of an installed CMS.   Create a free Cosmic JS account today and see how easy it is to free your content!  Let me know if you have any questions or comments in the comment section below.  You can also reach out to me on Twitter .

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » How I Moved My Blog From WordPress to Cosmic JS

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址