|
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
|
|
<etl>
|
|
<description>Convert Bugzilla database to Redmine</description>
|
|
<properties>driver=com.mysql.jdbc.Driver</properties>
|
|
<connection id="bugzilla" driver="mysql" url="jdbc:mysql://localhost:3306/bugzilla" user="root" password=""/>
|
|
<connection id="text" driver="text" url="file:///tmp/bug2red.sql"/>
|
|
|
|
<!-- Changes password to same as login id. Assumes Redmine on mysql uses sha1. Otherwise, set blank. -->
|
|
<!-- Change the mail column for your site -->
|
|
<query connection-id="bugzilla">
|
|
SELECT
|
|
login_name,
|
|
SHA1(login_name) AS hashed_password,
|
|
LEFT(realname, locate(' ', realname)) AS firstname,
|
|
SUBSTRING(realname, locate(' ', realname)) AS lastname,
|
|
login_name AS mail
|
|
FROM profiles;
|
|
<script connection-id="text">
|
|
INSERT INTO users (login,hashed_password,firstname,lastname,mail) VALUES ('$1','$2','$3','$4','$5');
|
|
</script>
|
|
</query>
|
|
|
|
<query connection-id="bugzilla">
|
|
SELECT
|
|
bug_id AS id,
|
|
assigned_to AS assigned_to_id,
|
|
reporter AS author_id,
|
|
creation_ts AS created_on,
|
|
short_desc AS description,
|
|
deadline AS due_date,
|
|
keywords AS subject
|
|
FROM bugs;
|
|
<script connection-id="text">
|
|
INSERT INTO issues (id,tracker_id,project_id,assigned_to_id,author_id,created_on,description,due_date,subject) VALUES ('$1','$1','1','$2','$3','$4','$5');
|
|
</script>
|
|
</query>
|
|
|
|
<!-- Bugzilla name is 64 chars. Redmine uses 30 chars -->
|
|
<query connection-id="bugzilla">
|
|
SELECT DISTINCT LEFT(name, 30) AS name FROM series_categories;
|
|
<script connection-id="text">INSERT INTO projects (name) VALUES ('$1');</script>
|
|
</query>
|
|
|
|
</etl>
|