This is it ! My first post writen with Nikola and, even better, all my website is now made only of static pages.
After serving me well during the past 12 years, Wordpress (thanks to Automattic and its community) will not power anymore my blog, which I expect to consule less resource and to require only marginally less maintenance.
The flexibility of Nikola allowed me to keep most of the organisation of this site untouched with remarkably few change of addresses for the content but still with a little bit of extra efforts that I'll describe below.
Walking through a Wordpress to Nikola migration
1. Exporting content from Wordpress
The conversion works from an XML export that Wordpress can do for you.
However, this export had a few shortcomings in my case.
First a hack in Wordpress's code is required to also expots the translations of the post and page titles as is indicated at https://github.com/qtranslate/qtranslate-xt/issues/199
In wp-admin/includes/export.php change `echo apply_filters( 'the_title_rss', $post->post_title ); to `echo apply_filters( 'the_title_export', $post->post_title );
Second I had to manually correct, in the exported file, some attachments paths that started by /mnt/sda... (ie those were absolute paths on the server's internal filesystem). But this happened only for the oldest posts (and so I guess the oldest versions of Wordpress).
2. Importing the content
However, since my blog used, over the time, several "generations" of an extension called qtranslate that helped publishing in french and english, some things were sadly off.
Then a simple command line invocation does most of the import job:
nikola import_wordpress --qtranslate --one-file --no-draft --export-comments -o site tlog.WordPress.2019-06-16.xml
The result is a perfectly fuctional website, with a raw look'n'feel that can be browsed on one's local machine:
nikola build && nikola serve
To add a more personal touch it is also very easy to play with and adapt Nikola's themes even though there isn's many.
3. Address changes
One thing that isn't automatic though is to update the relative links in the posts. These links end up pointing at the redirection pages which is totally fine. But a little search'n'replace session did help to improve this.
In any case the generation of redirection pages is very useful and it can even be abused to find a better middleground between the new and legacy url conventions by playing on the redirection map saved in the conf.py file and tweaking some preferences.
This way I renammed the "posts" folder into /blog to keep most posts at the exact same address while I stuck to Nikola's convention for "pages" in /pages.
One last thing after all this, the "translated" urls were, in my instance of Wordpress, below /blog/en whereas Nikola put them in /en/blog. And for this I prefered also to stick to Nikola's choice even if it costed me a few extra search'n'replaces.
4. What about photos galleries ?
To keep most information (title and descriptions) of the photo albums I had to write index pages for the galleries and album. But Nikola makes it quite easy to do anyway.
5. Statistics and comments
However, considering the few comments I used to recieve (not counting the spam) I prefered to stop bothering with comments.
Wordpress also had a visit statistics sytem that was quite nice to use and that's clearly where I'll loose the most. I could chose to track my users with Google analytics but I prefered to fallback to a much cruder non-tracking system offered by my host Dreamhost.
That's it !
Eventually most of the annoying issues I must say came from my bilingual set-up in my original site.
Hopefully this post can be useful to people with a weird set-up as I had and considering such a migration.