I have an installation of Instiki, installed very long ago, and always kept up to date. I find it very useful because it runs completely in the user home, so it can be easily synced across several computers. I don’t need to write formulas to the wiki, just text and snippets of code.
Since the beginning the chosen markup was Textile (maybe was the default back then…), now I see on the web that Textile is almost unused and I wish to migrate to Markdown.
Is it there a best practice for this kind migration? Was it tested before?
Do I need to write a script that reads the sqlite database and feeds the pages to pandoc and then back to the database before changing the markup setup in “edit web”, or it’s safe to switch from one markup dialect to the other?
Interesting question!
I guess the first question is: do you want to convert the whole history (ie all previous revisions of each page) to Markdown, or just the current version?
If you just need the current version converted, you can go to the “Export” tab, and click on “Markup” to create a zip archive containing the (Textile) markup of each page.
If you want to convert the previous revisions, too, then you should look at the rake tasks described on this page. Those instructions are geared towards migrating from one database (e.g. sqlite
) to another (e.g. MySQL). But they would also be useful in converting the content of the
revisions` table, without changing database engines.
db:fixtures:export_all
rake task dumps your database to a (series of) YAML file(s).db:fixtures:import_all
imports them to a (new) database.In between, you’d run a conversion on the dump/fixtures/revisions.yml
file.
Thanks for your quick reply, you gave me a good idea. Actually I didn’t think about the history, and luckily I don’t need to keep it. I’m the only user of my wiki, but since it was started long ago, the pages format wasn’t fully coherent, so a completely automated migration wasn’t possible, I also needed the old wiki running, as a reference. So in the end this is what I did:
pandoc file.textile -o file.markdown
in a BASH for cycle~/instiki
to ~/instikiold
~/instiki
It took a lot of time to clean everything up, but in the end all the pages were moved successfully.