Content
[SOLVED] Version 4.2 to 6.0 Data migration error
Added by Andrea Fabrizi over 8 years ago
Hi everyone,
I’ve just installed a brand new Openproject 6.0 on a Ubuntu 14.04 64bit server and it works fine.
My production installation is a Openproject 4.2 version and all my project,wikis, work packages,etc. are there.
Everything was installed using manual installation procedures
Now I’m trying to migrate my production content to my new OP 6.0 server, so I made a backup (MySql and configuration files) on the old server and the restore on the new server according to this page istructions
https://www.openproject.org/open-source/upgrade-backup/manual-installation-backup-guide/
At first it seems everything is ok, I can see all my projects with their work packages.
But when I click on “Administration” it crashes:
I, [2016-08-22T16:09:57.523879 #3930] INFO -- : Started GET "/admin/projects" for 172.16.16.228 at 2016-08-22 16:09:57 +0200 I, [2016-08-22T16:09:57.525049 #3930] INFO -- : Processing by AdminController#projects as HTML I, [2016-08-22T16:09:57.538638 #3930] INFO -- : Rendered admin/projects.html.erb within layouts/admin (7.1ms) I, [2016-08-22T16:09:57.538926 #3930] INFO -- : Completed 500 Internal Server Error in 14ms (ActiveRecord: 0.7ms) F, [2016-08-22T16:09:57.539701 #3930] FATAL -- : ActionView::Template::Error (Mysql2::Error: Unknown column 'repos.required_storage_bytes' in 'field list': SELECT SUM(required_disk_space) FROM (SELECT projects.*, wiki.filesize AS wiki_required_space, wp.filesize AS work_package_required_space, repos.required_storage_bytes AS repositories_required_space, (COALESCE(wiki.filesize, 0) + COALESCE(wp.filesize, 0) + COALESCE(repos.required_storage_bytes, 0)) AS required_disk_space FROM projects projects LEFT JOIN ( SELECT wiki.project_id, SUM(wiki_attached.filesize) AS filesize FROM wikis wiki JOIN wiki_pages pages ON pages.wiki_id = wiki.id JOIN attachments wiki_attached ON (wiki_attached.container_id = pages.id AND wiki_attached.container_type = 'WikiPage') GROUP BY wiki.project_id ) wiki ON projects.id = wiki.project_id LEFT JOIN ( SELECT wp.project_id, SUM(wp_attached.filesize) AS filesize FROM work_packages wp JOIN attachments wp_attached ON (wp_attached.container_id = wp.id AND wp_attached.container_type = 'WorkPackage') GROUP BY wp.project_id ) wp ON projects.id = wp.project_id LEFT JOIN repositories repos ON repos.project_id = projects.id) sub): 59: <i class="icon-info1"></i> 60: <%= l(:label_projects_storage_information, 61: count: Project.count, 62: storage: number_to_human_size(Project.total_projects_size, precision: 2)) %> 63: </p> 64: 65: <% if @projects.any? %> app/models/project/storage.rb:83:in `total_projects_size' app/views/admin/projects.html.erb:62:in `_app_views_admin_projects_html_erb__3423131825414465429_69903914549780' app/middleware/reset_current_user.rb:47:in `call' app/middleware/params_parser_with_exclusion.rb:40:in `call'
It seems I miss a database column!
The same happens even if I install version 5 instead of version 6
Any idea?
Thank you very much!
Andrea
Replies (4)
Hi Andrea,
did you run the database migrations on the new OpenProject version?
If you run it now, it should output no changes. (You can safely run the above command even if your database is at the last migration).
Best,
Oliver
Yes I did, but that was the trace:
Since I saw that error I supposed the db:migrate was unnecessary. So I was wrong… but it is still not working
How can I solve it?
Andrea
Hey Andrea,
it fails to migrate a specific plugin migration that was integrated into the core a while ago. I do wonder why that migration isn’t marked as complete.
You can mark it as completed and skip it using the following command:
and then re-run the migration above.
Oliver,
you made my day! It works like a charm!
For completeness I report all the commands
and then
Thank you again
Andrea