-
Notifications
You must be signed in to change notification settings - Fork 24
Migrating Redmine Wiki to GitHub
I wound up using Redemin's wiki on visitbugs to write a lot of useful content. And, I wanted to migrate it over to GitHub. So, capturing here steps I followed. Since GitHub wiki understands a slew of markdown formats, I just kept the Redmine content in textile format. Also, my Redmine wiki involved 2 projects, Silo and HPC-HDF5, and each project had just a two-level wiki; top index and individual topic pages with some attachments. So, not much involved in migrating to GitHub. I did it all manually though I could see a script being developed that would handle it easily.
- Created empty GitHub wiki and cloned it locally
- Went to top of Redmine Wiki getting list topic pages into an ascii text file (
foo
) - Modified above file to remove chars from page names that Redmine doesn't like (dot slash question mark, etc.)
- Looped over above list of files in shell
#!/bin/sh
while IFS= read -r var
do
rm "$var"
name=$(echo "$var" | tr '_' ' ')
echo "[$name]($var)" >> Home.md
wget -O "$var.textile" "https://visitbugs.ornl.gov/projects/silo/wiki/$var?format=txt"
done < foo
The above script creates link in Home.md
and then wget's the file into file with .textile
extension. Note the ?format=txt
at the end of the page URLs. That is essential to get the raw ascii text the files are formatted in.
- For each file with attachments, went to bottom of Redmine page in browser, where all attachments are listed, grapped each link by right clicking and manuall wget those images. There weren't a lot of these. If there had been, I would have scripted it.
A problem with GitHub wiki is it doesn't really allow sub-directories. I mean, it does, but all the pages in a tree of sub-dirs get rendered in GitHub wiki pages as one flat list of pages. You can still use sub-dirs to manage things yourself but it doesn't help in controlling how it all gets rendered on GitHub web interface.