[tsc-devel] Moinmoin wiki to Redmine wiki progress
Lauri Ojansivu |
Tue, 20 Oct 2015 00:59:56 UTC
Hi,
moinmoin wiki takes too much resources on Alexandria server.
I tried Redmine as alternative, installing it locally to my laptop.
I extracted redmine-3.1.1.tar.gz release tarball to my laptop.
Redmine install page is at:
https://www.redmine.org/projects/redmine/wiki/RedmineInstall
I installed postgres 9.3 to my laptop. Then I started postgres cli:
sudo -u postgres psql postgres
And run these SQL:
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'passwordhere' NOINHERIT
VALID UNTIL 'infinity';
CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
ALTER DATABASE redmine SET datestyle="ISO,MDY";
To get various gems to compile, I needed to install:
sudo apt-get install postgresql-server-dev-9.3
sudo apt-get install libmagickcore-dev
sudo apt-get install ruby-rmagick
bundle install --without development test rmagick
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production REDMINE_LANG=en bundle exec rake redmine:load_default_data
mkdir -p tmp tmp/pdf public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
To get iconv error fixed:
http://stackoverflow.com/questions/7829886/in-require-no-such-file-to-load-iconv-loaderror
I added to redmine Gemfile:
gem "iconv", "~> 1.0.3"
And then run
bundle install
For running Redmine locally, I used:
bundle exec rails server webrick -e production
For migrating wiki content, I used this page instructions:
http://ward.vandewege.net/blog/2011/11/migrate-moinmoinwiki-to-redmine/
And this page migration script:
http://ward.vandewege.net/blog/wp-content/uploads/2011/11/migrate_from_moinmoin.rake
Rake script needed to be copied to redmine/lib/tasks directory.
In the script, I got this error:
Encoding::CompatibilityError: incompatible encoding regexp match
(Windows-31J regexp with UTF-8 string)
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:275:in `gsub'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:275:in
`convert_wiki_text'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:29:in
`block (2 levels) in migrate'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:26:in `each'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:26:in
`each_with_index'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:26:in
`block in migrate'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:160:in
`block in each_page'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:157:in `each'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:157:in `each_page'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:22:in `migrate'
/home/lauri/wiki/redmine/lib/tasks/migrate_from_moinmoin.rake:293:in
`block (2 levels) in <top (required)>'
Tasks: TOP => redmine:migrate_from_moinmoin
(See full trace by running task with --trace)
So to fix that error, I had to change this code there:
# throw away pragma statements
text = text.gsub(/^#pragma (.*)$/is) {|s| ""}
In that code /is and specially s is remaining of converted code from
perl to ruby, so I changed it to multiline regex /m like this:
# throw away pragma statements
text = text.gsub(/^#pragma (.*)$/m) {|s| ""}
I created empty TSC project to Redmine.
In that rake file near bottom of file, I also needed to setup paths to
moinmoin wiki files, and redmine wiki project id tsc:
prompt('Target project identifier', :default => 'tsc') {|identifier|
MMMigrate.target_project_identifier identifier}
prompt('Path to MoinMoin pages folder', :default =>
'/home/username/wiki/var/local/moinmoin/data/pages')
Then in the redmine directory I did run:
rake redmine:migrate_from_moinmoin RAILS_ENV=production
So now wiki pages are imported into my local Redmine.
I have already fixed most of the wiki markup differences in wiki,
uploaded missing image attachments, and removed some spam pages, but
there's still some pages to fix.
Here's screenshot of current wiki homepage at my Redmine:
http://www.xet7.org/TSCRedmineWiki.png
- for that screenshot I changed language to English first, because
Redmine did originally show interface in mostly Finnish.
BR,
xet7