Project

General

Profile

Can two Redmine servers be synchronized?

Added by Smorgas Borg over 10 years ago

I have been tasked with synchronizing two Redmine servers that are in two different departments. Management has decided that they will not be allowed to communicate with each other directly and all synchronization will be a weekly, manual process. I would like to know if there is an existing process to handle something like this. I haven't found anything that appears to support it, so it looks like I will have to code it myself.

I have already written a Java program to import existing issues from ClearQuest because the Redmine import plugin wouldn't process all of our data. The program mostly uses the Redmine API (https://github.com/taskadapter/redmine-java-api) and REST service but those don't allow me to set certain fields like the creation date. The program that I've written uses hibernate to update those fields after the record is created. It looks like I will have to expand the import program's hibernate processing to handle the synchronization unless someone knows of an alternative solution. As the title states, I'm looking for synchronization ideas that I may have missed in my research.

Some background - I have been studying the database, REST services and a Redmine API for the last two months and I think that I have a decent understanding of the processes. However, I know nothing about Ruby or Rails so I have no idea what Redmine does internally. I don't have the time to learn them either. Management is not going to purchase anything for this effort unless it is a small (< $1K), one time purchase.

Thanks in advance for your replies.


Replies (4)

RE: Can two Redmine servers be synchronized? - Added by Pavel Potcheptsov over 10 years ago

Let's say you have two redmine instances with number of different users, projects, issues.
Am I right that you want to achieve such state after sync, when all data from other redmine is present on current and vice versa?
How do you think to resolve the same users_id, the same issues_id and etc?

RE: Can two Redmine servers be synchronized? - Added by Ivan Cenov over 10 years ago

Hmm... two Redmine sites work independently each from other and on the weekends each receives the changes from the other. I can't imagine reasonable way to do this. Redmine is a web system that makes people work together. It's a connecting application. Management wants to separate people.

The solution is not Redmine. The solution is to make VPN between both departments and make people work together. I think that the price for support of two Redmine sites that get mixed time to time is [much] bigger than one time buying of hardware that makes all these departments connected.

RE: Can two Redmine servers be synchronized? - Added by Smorgas Borg over 10 years ago

Pavel Potcheptsov wrote:

Let's say you have two redmine instances with number of different users, projects, issues.
Am I right that you want to achieve such state after sync, when all data from other redmine is present on current and vice versa?
How do you think to resolve the same users_id, the same issues_id and etc?

I am aware of the issues with synching the IDs which is why I'm asking before I attempt a solution on my own. My manager and I have discussed setting one database with all IDs starting at a sufficently high enough number so that there won't be conflicts with the other when new records are created in either database. I've tested the import of a new record by creating a stub of an issue with Hibernate using a specific ID and then updating the "new" record using REST and Hibernate - it looks like it will work without any issues. Of course, there are a lot of tables with IDs so, I have my work cut out for me.

My main concern is that the defaults for the tables only go to 10 digits and I would prefer to set them a little higher. We have a lot of custom fields which causes the custom_fields table to grow significantly faster than the other tables. That table might hit the 500 million midpoint within a few years. Would Redmine work if it encountered 14 digit IDs? I'll test it no matter what but, it would be nice to know what to expect.

Ivan Cenov wrote:

Hmm... two Redmine sites work independently each from other and on the weekends each receives the changes from the other. I can't imagine reasonable way to do this. Redmine is a web system that makes people work together. It's a connecting application. Management wants to separate people.

The solution is not Redmine. The solution is to make VPN between both departments and make people work together. I think that the price for support of two Redmine sites that get mixed time to time is [much] bigger than one time buying of hardware that makes all these departments connected.

Ivan, creating a VPN or tying the systems directly together is not an option because they will be on completely different networks that are not and can not be connected. This is something that can't be gotten around.

RE: Can two Redmine servers be synchronized? - Added by Scott H over 10 years ago

I don't have much experience with hooks, but those would probably be the first place I would go to. Using hooks, save a record of all the transactions made on the site. Copy those transactions over to the other site, and have a script re-create them (using api or direct database updates or whatever). When a new object is created, keep a table of how the IDs match up to use for future modifications.

The really tricky part is if people are working on the same objects at the same time. If one side sets an issue at 30% done, and another at 20%, should they be added to 50%, or set to the last one changed, or does one side have authority, or what? If tasks have a certain workflow, what if they get set to states out of order...and without looking up the code, I'm not sure how tricky it would be to make things like forum posts not be out of order. If you are doing simultaneous modifications, you're probably going to need to carefully consider a lot of specific cases.

And hooks would require dealing with redmine internals. Maybe it'd be possible to pull all the changes from the database, but you'd almost certainly lose historical data using just the api.

    (1-4/4)