プロジェクト

全般

プロフィール

Vote #63212

未完了

Import wiki pages from MediaWiki

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Importers_15
対象バージョン:
-
開始日:
2008/05/12
期日:
進捗率:

0%

予定工数:
category_id:
15
version_id:
0
issue_org_id:
1224
author_id:
674
assigned_to_id:
0
comments:
7
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Here's a rake task that will migrate pages from MediaWiki. It will prompt you for the required information, such as mediawiki database connection, target redmine project to translate pages into, target mediawiki page, redmine page author, and whether to use the mediawiki page target as a namespace base to translate multiple pages.

It will prompt you at each page to decide whether to translate the page or not. MediaWiki ':' separators are translated to '_' in redmine.

It won't download images from mediawiki, but it will translate the image tags, so you'll just have to attach the images to the page in redmine after it's been translated.

It also won't retain mediawiki in-line table formatting.

As always, fixes/improvements are welcome. This worked well enough for me, but obviously it doesn't cover absolutely everything.


journals

Hi,
thanks for the target. I get the following error trying import from mediawiki1.7 to redmine 0.7.1

<pre>
Target project identifier [CommCore]: testwiki
Created Project: Testwiki
rake aborted!
uninitialized constant MWMigrate::TRACKER_BUG
/srv/redmine/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:263:in `load_missing_constant'
/srv/redmine/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in `const_missing'
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:279:in `target_project_identifier'
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:350
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:332:in `prompt'
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:350
/usr/lib/ruby/1.8/rake.rb:387:in `call'
/usr/lib/ruby/1.8/rake.rb:387:in `execute'
/usr/lib/ruby/1.8/rake.rb:387:in `each'
/usr/lib/ruby/1.8/rake.rb:387:in `execute'
/usr/lib/ruby/1.8/rake.rb:357:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:350:in `invoke'
/usr/lib/ruby/1.8/rake.rb:1906:in `run'
/usr/lib/ruby/1.8/rake.rb:1906:in `each'
/usr/lib/ruby/1.8/rake.rb:1906:in `run'
/usr/bin/rake:4
</pre>
--------------------------------------------------------------------------------
Updated code. Sorry, I never used the bit that creates a new project...
--------------------------------------------------------------------------------
Hi,
I can go trough the wizard but I get the following error at the end:
<pre>
WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

MW directory [/var/www/html/mediawiki-1.8.2]: /var/lib/mediawiki/
MW database adapter (sqlite, sqlite3, mysql, postgresql) [mysql]: postgresql
MW database host [localhost]: *IP_host*
MW database port []: 5432
MW database socket []:
MW database name [wikidb]: *wikidb_name*
MW database username [wiki]: *username*
MW database password [wikidb]: *password*
MW database encoding [UTF-8]:
Target project identifier [CommCore]: commcore3
Created Project: Commcore3
MW Page Title [CommCore:Devel:XMLDB]: Main_Page
Page Author [carlnygard@fortna.com]: *new_mail*
Whole namespace (Y/n)? [y]: y

No wiki defined
Migrating Main_Page, 1 of 259 pages
Translate Reserve_windows (y/N)? y
rake aborted!
PGError: ERROR: relation "text" does not exist
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = 'text'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/srv/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log'
/srv/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:395:in `query'
/srv/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:836:in `column_definitions'
/srv/redmine/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:485:in `columns'
/srv/redmine/vendor/rails/activerecord/lib/active_record/base.rb:1080:in `columns'
/srv/redmine/vendor/rails/activerecord/lib/active_record/base.rb:1088:in `columns_hash'
/srv/redmine/vendor/rails/activerecord/lib/active_record/base.rb:1259:in `find_one'
/srv/redmine/vendor/rails/activerecord/lib/active_record/base.rb:1250:in `find_from_ids'
/srv/redmine/vendor/rails/activerecord/lib/active_record/base.rb:504:in `find'
/srv/redmine/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb:44:in `find_target'
/srv/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:133:in `load_target'
/srv/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:55:in `reload'
/srv/redmine/vendor/rails/activerecord/lib/active_record/associations.rb:992:in `text'
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:176:in `migrate'
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:168:in `each'
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:168:in `migrate'
/srv/redmine/lib/tasks/migrate_from_mediawiki.rake:360
/usr/lib/ruby/1.8/rake.rb:387:in `call'
/usr/lib/ruby/1.8/rake.rb:387:in `execute'
/usr/lib/ruby/1.8/rake.rb:387:in `each'
/usr/lib/ruby/1.8/rake.rb:387:in `execute'
/usr/lib/ruby/1.8/rake.rb:357:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:350:in `invoke'
/usr/lib/ruby/1.8/rake.rb:1906:in `run'
/usr/lib/ruby/1.8/rake.rb:1906:in `each'
/usr/lib/ruby/1.8/rake.rb:1906:in `run'
/usr/bin/rake:4
</pre>

If I answer 'No' to the last question the script ask to translate the next page and so on. I executed the import on mediawiki 1.12 and 1.9

A big thank for your time.
--------------------------------------------------------------------------------

The script was written agains MW 1.8.2. Most likely they have changed the schema from what I coded. You'll have to download the mediawiki schema document and sort things out for yourself. You may even need to change the script, depending on what they've changed in the schema.
--------------------------------------------------------------------------------
I think this ticket is obsolete. The script maybe work only for some very old version of mediawiki.
--------------------------------------------------------------------------------
could that be closed?
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリImporters_15 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0