Forums Instiki

Migration from Textile

Subscribe to Migration from Textile 3 posts, 2 voices

Francesco Ta... 6 posts

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?

distler Moderator 77 posts

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.

  • The 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.

Francesco Ta... 6 posts

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:

  1. exported as you suggested the whole wiki, the result is a convenient “file per page”
  2. converted the files with the command pandoc file.textile -o file.markdown in a BASH for cycle
  3. moved existing installation from ~/instiki to ~/instikiold
  4. installed a new, empty, instance in ~/instiki
  5. launched the two instances together, on different ports
  6. opened all files in jedit to correct in a single shot all repetitive errors
  7. imported every page from file, one by one (starting with the smaller files!)

It took a lot of time to clean everything up, but in the end all the pages were moved successfully.

Forums Instiki