ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Problems in redmine to chiliproject migration

Added by Sebastien Pasche at 2013-02-11 11:08 am

Hello

I try to migrate from Redmine 1.2.1.stable.6543 (MySQL) to the last version of chiliproject.

I copied the database into a new one, I have set the database.yml settings to connect to this new base and I followed the "upgrading" way.

But when I try to run the rake script of database migration I get this error :

[root@ecudesp chiliproject]# bundle exec rake db:migrate RAILS_ENV=production
==  BuildInitialJournalsForActsAsJournalized: migrating =======================
-- Building initial journals for Message
   -> 0.0009s
-- Building initial journals for Attachment
   -> 66.5171s
-- Building initial journals for Document
rake aborted!
An error has occurred, all later migrations canceled:

undefined method `id' for nil:NilClass
/var/www/cgi-bin/chiliproject/app/models/document.rb:46:in `after_initialize'
/var/www/cgi-bin/chiliproject/vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb:79:in `new'
/var/www/cgi-bin/chiliproject/vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb:79:in `recreate_initial_journal!'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:45:in `block (3 levels) in up'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:41:in `block (2 levels) in up'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:30:in `block in up'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:29:in `each'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:29:in `up'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

There are information about the release I cloned

[root@ecudesp chiliproject]# git show
commit 3f9007b9090b29bb7eabdfb1c3325c068077da27
Merge: 2854524 6bef9c2
Author: Felix Schäfer <felix@fachschaften.org>
Date:   Tue Jan 29 22:37:23 2013 +0100

    Merge branch 'release-v3.6.0' into stable

[root@ecudesp chiliproject]# 

Any ideas as to where it could come from?


Replies (3)

RE: Problems in redmine to chiliproject migration - Added by Sebastien Pasche at 2013-02-11 11:18 am

Following a lead on irc we tryed something

<meineerde> braoru: that can happen when you have journal entries left for objects which are deleted by hand
<meineerde> braoru: you can search in jour journals table for entries with journalized_type == "Document"  and a journalized_id of a document that isn't there anymore.

But there is no entry of type Document in the database

mysql> select count(*),type from journals group by type;
+----------+-------------------+
| count(*) | type              |
+----------+-------------------+
|     2936 | AttachmentJournal |
|    23654 | IssueJournal      |
+----------+-------------------+
2 rows in set (0.01 sec)

RE: Problems in redmine to chiliproject migration - Added by Sebastien Pasche at 2013-02-11 11:40 am

Following meineerde lead I tried to find what (if there is one) id the default document type.

mysql> select * from enumerations;
+----+-------------------------+----------+------------+-------------------+--------+------------+-----------+
| id | name                    | position | is_default | type              | active | project_id | parent_id |
+----+-------------------------+----------+------------+-------------------+--------+------------+-----------+
|  2 | Technical documentation |        1 |          0 | DocumentCategory  |      1 |       NULL |      NULL |
|  3 | Low                     |        1 |          0 | IssuePriority     |      1 |       NULL |      NULL |
|  4 | Normal                  |        2 |          1 | IssuePriority     |      1 |       NULL |      NULL |
|  5 | High                    |        3 |          0 | IssuePriority     |      1 |       NULL |      NULL |
|  8 | Design                  |        1 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
|  9 | Development             |        2 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
| 10 | Meeting                 |        3 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
| 11 | Training                |        4 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
| 12 | Vacation (vacances)     |        5 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
| 13 | Disease (malade)        |        6 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
| 14 | Support                 |        7 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
| 15 | LSD                     |        8 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
| 16 | Vacation (vacances)     |        9 |          0 | TimeEntryActivity |      0 |          3 |        12 |
| 17 | Disease (malade)        |       10 |          0 | TimeEntryActivity |      0 |          3 |        13 |
| 18 | Vacation (vacances)     |       11 |          0 | TimeEntryActivity |      0 |          2 |        12 |
| 19 | Disease (malade)        |       12 |          0 | TimeEntryActivity |      0 |          2 |        13 |
| 20 | Vacation (vacances)     |       13 |          0 | TimeEntryActivity |      0 |          4 |        12 |
| 21 | Disease (malade)        |       14 |          0 | TimeEntryActivity |      0 |          4 |        13 |
| 22 | Training                |       15 |          0 | TimeEntryActivity |      1 |          6 |        11 |
| 23 | Vacation (vacances)     |       16 |          0 | TimeEntryActivity |      0 |          6 |        12 |
| 24 | Disease (malade)        |       17 |          0 | TimeEntryActivity |      0 |          6 |        13 |
| 25 | Support                 |       18 |          0 | TimeEntryActivity |      1 |          6 |        14 |
| 26 | LSD                     |       19 |          0 | TimeEntryActivity |      1 |          6 |        15 |
| 27 | Meeting                 |       20 |          0 | TimeEntryActivity |      1 |          6 |        10 |
| 28 | Vacation (vacances)     |       21 |          0 | TimeEntryActivity |      0 |          7 |        12 |
| 29 | Disease (malade)        |       22 |          0 | TimeEntryActivity |      0 |          7 |        13 |
| 30 | Vacation (vacances)     |       23 |          0 | TimeEntryActivity |      0 |          8 |        12 |
| 31 | Disease (malade)        |       24 |          0 | TimeEntryActivity |      0 |          8 |        13 |
| 33 | Meeting minutes         |        2 |          0 | DocumentCategory  |      1 |       NULL |      NULL |
+----+-------------------------+----------+------------+-------------------+--------+------------+-----------+
29 rows in set (0.00 sec)

There is no default type, I set the is_default to 1 for the id 2.

mysql> update enumerations set is_default=1 where id = 2;
Query OK, 1 row affected (0.00 sec)

And try to re-launch the migration script

[root@ecudesp chiliproject]# bundle exec rake db:migrate RAILS_ENV=production
==  BuildInitialJournalsForActsAsJournalized: migrating =======================
-- Building initial journals for Message
   -> 0.0009s
-- Building initial journals for Attachment
   -> 64.6090s
-- Building initial journals for Document
   -> 0.1795s
-- Building initial journals for Changeset
   -> 113.3160s
-- Building initial journals for Issue
rake aborted!
An error has occurred, all later migrations canceled:

can't convert nil into Integer
/var/www/cgi-bin/chiliproject/vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb:102:in `recreate_initial_journal!'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:45:in `block (3 levels) in up'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:41:in `block (2 levels) in up'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:30:in `block in up'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:29:in `each'
db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:29:in `up'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
[root@ecudesp chiliproject]# 

Ok for the document but here is another error in the issues migration about type conversion.

RE: Problems in redmine to chiliproject migration - Added by Chris Dähn at 2013-02-12 11:45 pm

Ah, I had the "nil" errors, too. Often these result in deleted users, so going through the history would crash the migration scripts...

Do you have deleted projects, users or comparable resources which are referenced in the journals?

(1-3/3)