<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://scox.info/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>scox.info - Random Thoughts - dotclear</title>
  <link>http://scox.info/</link>
  <description></description>
  <language>en</language>
  <pubDate>Wed, 11 Aug 2010 14:18:42 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Migrating from Mephisto to Dotclear 2</title>
    <link>http://scox.info/post/2008/06/10/Migrating-from-Mephisto-to-Dotclear-2</link>
    <guid isPermaLink="false">urn:md5:977d6bfa842850f31311d1d3a130f3e6</guid>
    <pubDate>Tue, 10 Jun 2008 02:42:00 +0200</pubDate>
    <dc:creator>scox</dc:creator>
        <category>code</category>
        <category>dotclear</category><category>mephisto</category>    
    <description>    &lt;p&gt;It's been a while since my last post. Beside the fact that I was busy, the reason preventing me from posting is that the blogging engine I was using (&lt;a href=&quot;http://mephistoblog.com/&quot; hreflang=&quot;en&quot;&gt;Mephisto&lt;/a&gt;) was in a bad shape.
It seemed &lt;a href=&quot;http://mephistoblog.com/2007/3/22/is-mephisto-dead&quot; hreflang=&quot;en&quot;&gt;unmaintaned&lt;/a&gt;, managed to consume all the server memory and didn't survive a rails upgrade.&lt;/p&gt;


&lt;p&gt;That's why I've decided to migrate to &lt;a href=&quot;http://dev.dotclear.net/2.0/&quot; hreflang=&quot;fr&quot;&gt;Dotclear 2&lt;/a&gt;, which seems to be a nice and clean blogging engine.
However, in the migration process, I didn't want to lose:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All my previsous posts (both published and pending)&lt;/li&gt;
&lt;li&gt;All the comments&lt;/li&gt;
&lt;li&gt;Associated metadata (categories, tags and so on)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dotclear has a nice builtin plugin called &lt;em&gt;Import/Export&lt;/em&gt; which let you save and restore backups of your blog.
All I did was writing a Ruby script that generates a dump of the Mephisto database using &lt;em&gt;ActiveRecord&lt;/em&gt; in the same format as &lt;em&gt;Import/Export&lt;/em&gt;, ready to be imported.
It is available &lt;a href=&quot;http://scox.info/public/code/export_to_dc2.rb&quot;&gt;here&lt;/a&gt; and works in the following way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Place it under the &lt;em&gt;script&lt;/em&gt; directory of your Mephisto rails root&lt;/li&gt;
&lt;li&gt;Edit the first lines (set your Dotclear 2 &lt;strong&gt;login&lt;/strong&gt; and &lt;strong&gt;blog id&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Run it and redirect the output to your favorite location:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;ruby script/migrate_to_dc2.rb &amp;gt; public/dump.dc2&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Retrieve the dump file (e.g. dump.dc2) and import it in the &quot;Import/Export&quot; area, under the &lt;em&gt;Import a single blog&lt;/em&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That's it, you're done. It should have imported all your blog posts (and preserved publish dates as well as many other attributes), comments, metadatas etc.&lt;/p&gt;


&lt;p&gt;I also wanted to maintain backward URL compatibility with Mephisto. A couple of &lt;em&gt;mod_rewrite&lt;/em&gt; rules did the trick:&lt;/p&gt;
&lt;pre&gt;
# Mephisto URL compatiblity
RewriteEngine On
# Feeds
RewriteRule ^/feed/atom.xml /feed/atom [L,R=301]
RewriteRule ^/feed/all_comments.xml$ /feed/atom/comments [L,R=301]
# Posts
RewriteRule (^/200\d.*) /post$1 [QSA,L,R=301]
&lt;/pre&gt;


&lt;p&gt;That's all. I hope it will be useful to anyone wishing to migrate to Dotclear 2, as the process of creating that script is quite annoying :)&lt;/p&gt;</description>
    
          <enclosure url="http://scox.info/public/code/export_to_dc2.rb"
      length="4598" type="text/plain" />
    
    
          <comments>http://scox.info/post/2008/06/10/Migrating-from-Mephisto-to-Dotclear-2#comment-form</comments>
      <wfw:comment>http://scox.info/post/2008/06/10/Migrating-from-Mephisto-to-Dotclear-2#comment-form</wfw:comment>
      <wfw:commentRss>http://scox.info/feed/rss2/comments/7</wfw:commentRss>
      </item>
    
</channel>
</rss>