Project

General

Profile

Migrate ONE project to another Redmine server

Added by Alexis GUNST almost 14 years ago

Hello to everybody,

I've a big problem.

  • I have an existant Redmine Installation which is working (Debian/Mysql)
  • I have a project hosted on an external Redmine server
  • I want to move this hosted project to my Redmine server.

How to proceed ?
I have a root access to the hosted redmine if needed.

I want to export only ONE project, not all.
Is it possible ?

Thanks a lot for your answer !


Replies (4)

RE: Migrate ONE project to another Redmine server - Added by Adrien Crivelli almost 14 years ago

Hello,

I just wrote a PHP script to do exactly that. You may find there: https://github.com/PowerKiKi/redmine-tools
Be sure to test it out before using on production database. You'll find basic instructions in migrator.php

RE: Migrate ONE project to another Redmine server - Added by Anonymous almost 8 years ago

I think that this tool might interest you : https://github.com/dctremblay/Project-Rescue

With that tool, you can migrate individual project from Redmine 2.x / 3.2 from an instance to another with all their dependencies (issues, users, parent projects, children projects, news, documents, attachments, custom fields etc..)

It is a script made in Python3 so make sure that it is already installed.

RE: Migrate ONE project to another Redmine server - Added by Allan Vig almost 8 years ago

Looks just like the tool I want, however I need to migrate from MySQL -> MSSQL and are not skilled enough to modify the orm.py file to make that connection work. Hopefully it will be added in the near future.

RE: Migrate ONE project to another Redmine server - Added by Seung Soo Mun about 4 years ago

Current Redmine could filter the issues and send them to the REST API of the external server

  1. Create a proper rake task: /usr/share/redmine/lib/tasks/migrate_to_redmine.rake
    namespace :redmine do
      desc 'Migrate to another Redmine'
      task :migrate_to_redmine => :environment do
    
        query = IssueQuery.new(:project => Project.find(123), :name => 'CurrentProject')
        query.add_filter('status_id', '*', [''])
        query.add_filter('parent_id', '!*', [''])
    #    query.add_filter("issue_id", '><', ['32500', '42100'])
        issues = Issue.joins(:status, :tracker, :project, :priority).where(query.statement).to_a
    
        issues.sort.each do |issue|
          migrate_issue issue.id, nil
        end
    
      end
    
      def migrate_issue id, parent_id
        issue = Issue.find(id)
    
        created = {POST issue to the REST API of the external server}
    
        if created
          for child in issue.children
            migrate_issue child.id, created.id
          end
        end
      end
    
    end
    
  2. cd /usr/share/redmine/
  3. rake redmine:migrate_to_redmine
    (1-4/4)