{"id":1824,"date":"2022-10-20T01:54:30","date_gmt":"2022-10-19T17:54:30","guid":{"rendered":"https:\/\/rogen.us\/how-to-migrate-wordpress-site-to-ghost-blog-and-deploy-to-github-pages\/"},"modified":"2022-10-20T01:54:30","modified_gmt":"2022-10-19T17:54:30","slug":"how-to-migrate-wordpress-site-to-ghost-blog-and-deploy-to-github-pages","status":"publish","type":"post","link":"https:\/\/rogen.us\/en\/how-to-migrate-wordpress-site-to-ghost-blog-and-deploy-to-github-pages\/","title":{"rendered":"How to migrate wordpress site to ghost blog and deploy to github pages."},"content":{"rendered":"<p><![CDATA[\n\n<p>It is worth noting that this tutorial cannot completely migrate wordpress to ghost blog, only articles.<\/p>\n\n\n\n\n\n<p>After my test, we can&#8217;t migrate the articles in wordpress to ghost blog at one time, I recommend backing up 20 articles each time.<\/p>\n\n\n\n\n\n<p>Preparation: Install <code>nodejs<\/code>, <code>ghost blog<\/code> locally, and successfully enter the ghost blog backend, that is, run the <code>npm start<\/code> command in the project file, and then set <a href=\"http:\/\/12.0.0.1:2368\/ghost\">http:\/\/12.0.0.1:2368\/ghost<\/a>.<\/p>\n\n\n\n\n\n<p>Next, export 20 wordprss articles as <code>20.xml<\/code>.<\/p>\n\n\n\n\n\n<p>Then, we need to use the following tools: <code>wp2ghost<\/code> <\/p>\n\n\n\n\n\n<p>Through the <code>wp2ghost<\/code> tool, we can convert <code>20.xml<\/code> to <code>20.json<\/code>, which is the format supported by ghost blog.<\/p>\n\n\n\n\n\n<p>Then, we can restore the articles in <code>20.json<\/code> through the Import function in the ghost blog <code>Labs<\/code> option.<\/p>\n\n\n\n\n\n<p>Because ghost blog is a dynamic blog system, and <code>github page<\/code> only supports static files. So we have to convert the articles we just restored into static files.<\/p>\n\n\n\n\n\n<p>The next action needs to be done with the local ghost blog running.<\/p>\n\n\n\n\n\n<p>Go to the local ghost blog theme directory, run the <code>buster generate<\/code> command, then you will get a folder called <code>static<\/code>, which contains the static files of ghost blog, the next step is to upload these static files to your <code>github page<\/code>.<\/p>\n\n\n\n\n\n<p>As for how to upload the <code>static<\/code>  to a github page and define a domain name, there are many tutorials available online.<\/p>\n\n]]><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is worth notin&#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[250],"tags":[],"class_list":["post-1824","post","type-post","status-publish","format-standard","hentry","category-coding-notes","wpcat-250-id"],"views":90,"_links":{"self":[{"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/posts\/1824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/comments?post=1824"}],"version-history":[{"count":0,"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/posts\/1824\/revisions"}],"wp:attachment":[{"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/media?parent=1824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/categories?post=1824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rogen.us\/en\/wp-json\/wp\/v2\/tags?post=1824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}