I had my old blog based on SPIP, and I wanted to keep all the posts together, to make it easier to migrate in the future.
Initially, I migrated my posts from blogger, where there’s an option to export the contents and some plugins to allow easier importing to markdown files (to be used by OctoPress), those were the recent posts, so part of the job was already done there.
Next step, was to migrate old posts on my SPIP site.
SPIP, being not as popular as other solutions, might lack plugins for importing the data, but has a nice feature: it allows to provide full article contents via RSS.
- I entered into my site private area
- Entered to the administration section and under
Content, I temporarily changed the syndication settings to provide full articles instead of just summary.
- Then, I visited the url for my user, but on the RSS generator template:
spip.php?page=backend&id_rubrique=6, and saved it as file.xml
At this point I needed some software for automating the initial conversion, so I went to python’s
feedparser libraries to perform this with a bit of coding:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
After each iteration, a new file was created using the old http link to the article (which already had stripped problematic characters).
Just moving those files to
source/_posts allows me to re-publish them on a different site, and later work the conversion to markdown by using
pandoc and some manual tuning.