{"id":183,"date":"2010-01-11T00:17:56","date_gmt":"2010-01-11T08:17:56","guid":{"rendered":"http:\/\/www.robinstewart.com\/blog\/?p=183"},"modified":"2010-01-11T00:17:56","modified_gmt":"2010-01-11T08:17:56","slug":"a-story-of-blog-consolidation","status":"publish","type":"post","link":"https:\/\/www.robinstewart.com\/blog\/2010\/01\/a-story-of-blog-consolidation\/","title":{"rendered":"A story of blog consolidation"},"content":{"rendered":"<p>For a while now I&#8217;ve been wanting to consolidate all of my blog entries into a blog system that runs in my own web space. \u00a0That way, I can customize the blog as much as I want, I can be confident that I&#8217;ll never have to pay extra for it (beyond what I already pay for web hosting), and I can give it a nice url like <a href=\"https:\/\/www.robinstewart.com\/blog\/\">robinstewart.com\/blog\/<\/a>.<\/p>\n<p>The only problem was that the process of transferring my old blog entries into the new blog system turned out to be waaaay more time-consuming than I had hoped. \u00a0That is the moral of this story. \u00a0But if you&#8217;re interested in all the nerdy details, read on.<\/p>\n<p>I started writing occasional blog entries back in 2006.\u00a0I originally used a <a href=\"http:\/\/wso.williams.edu\/blogs\/robin\/\">blog provided through Williams College<\/a>. \u00a0Then at some point I switched to a <a href=\"http:\/\/robinsinterestingthoughts.blogspot.com\/\">blog hosted by Blogger<\/a> (but I left the old entries in the old blog). \u00a0Now that it has become easy to install WordPress on my own website, <a href=\"https:\/\/www.robinstewart.com\/blog\/\">I did so<\/a>. \u00a0But to really make the transition, I had to move all of the blog entries from the two old systems into the new system. \u00a0How hard could that be?<\/p>\n<p>Well, the Williams blog was hosted in an extremely old, &#8220;multi-user&#8221; WordPress installation. \u00a0I made an attempt to upgrade that system to the latest version so that it would gain the &#8220;export&#8221; feature. \u00a0But after reading a lot of <a href=\"http:\/\/codex.wordpress.org\/Upgrading_WPMU\">documentation<\/a>, I decided that the process would be long, tedious, and fraught with peril (both because it is a &#8220;multi-user&#8221; version and would have to be upgraded through a series of new releases, one by one). \u00a0Instead, I ended up writing a PHP script that pulled my blog post information (title, text, date, author, etc) from the underlying MySQL database and exported it in the XML format that newer versions of WordPress can import. \u00a0After a few iterations of this script, I was able to successfully import the resulting file into my new WordPress system. \u00a0(Thankfully, the date\/time format has not changed since the old WordPress version.)<\/p>\n<p>The next step was to import my newer blog entries from Blogger. \u00a0The new WordPress has an option to do this import directly. \u00a0You provide your login information and it goes and automatically fetches all of the blog entries. \u00a0That import went smoothly, but the HTML underlying the blog entries I had created in Blogger were full of extra &lt;div&gt;s so that the entries didn&#8217;t render properly alongside normal, clean WordPress-generated blog entries. \u00a0I considered doing some CSS hacking to make the Blogger entries look ok, but after some experimenting to no avail I decided it would be a lot better to have clean HTML anyway.<\/p>\n<p>To achieve that, I ended up <em>exporting<\/em> from my new WordPress system all of the blog entries that I had by now imported. \u00a0I opened the resulting XML export file in a text editor, and performed some judicious find-and-replace-all operations to get rid of those extraneous &lt;div&gt; tags (while keeping the important ones). \u00a0Then, I deleted all of the entries from WordPress and re-imported my edited XML file. \u00a0Unfortunately, this re-import didn&#8217;t quite work (the importer web page just hung indefinitely). \u00a0But I was eventually able to work around the problem by splitting up the XML file into about five different files, and importing them separately.<\/p>\n<p>Finally, all of my old blog posts were in my new system, and in a way that looked fine without CSS hacks. \u00a0Whew! \u00a0It may have been faster to retype them all by hand.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a while now I&#8217;ve been wanting to consolidate all of my blog entries into a blog system that runs in my own web space. \u00a0That way, I can customize the blog as much as I want, I can be confident that I&#8217;ll never have to pay extra for it (beyond what I already pay &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.robinstewart.com\/blog\/2010\/01\/a-story-of-blog-consolidation\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;A story of blog consolidation&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/posts\/183"}],"collection":[{"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":0,"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.robinstewart.com\/blog\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}