Danita
Danita

Reputation: 2514

How to modify repository settings in Redmine?

It might sound like a dumb question but I can't for the life of me find the answer to this one.

We have a project set up in Redmine and linked to an SVN repository. Everything is working fine, but we recently did a repository relocation and we needed to update its Redmine repository path setting to point to the new repo.

The problem is that the option is grayed out and I can't change it. I suppose you could click on "Delete" and create a new one, but that option really sounds scary to try (the URL has the word /destroy/ in it!!) and I don't want to wipe out the repo. There's no reference I could find about this in the Redmine manual. What should I do?

Also --related to this-- do you know if all ticket references in old commits will still be pointing at the right places?

Upvotes: 17

Views: 9862

Answers (6)

Tono Wiedermann
Tono Wiedermann

Reputation: 608

Be very careful with deletion of repository in redmine. It does not delete your physical repository but it does delete all that redmine stores for the repository like links to issues. These often can not be restored (by import from relocated repository) because some are created manually and in my case some links were created long ago using another pattern in commit comment.

the only way to relocate repository without losing link data is to update the URL directly in database (it is read only in Settings page). for example as suggested by dotancohen

UPDATE repositories SET url='newurl', root_url='newurlroot' WHERE url='oldurl';

Upvotes: 0

dotancohen
dotancohen

Reputation: 31471

This is the MySQL query to run on the Redmine database to change the repository location:

UPDATE repositories SET url='/opt/git/NEW_LOCATION.git', root_url='/opt/git/NEW_LOCATION.git' WHERE url='/opt/git/OLD_LOCATION.git';

Upvotes: 2

Omni5cience
Omni5cience

Reputation: 944

Another option could be by changing the values in 'repository' table. It works pretty well in case of repository relocation.

I wouldn't recommend this unless you know for sure that they are exactly the same.


P.S. I just realized how old this question is, but I think it's still relevant.

Upvotes: 3

Vinod Singh
Vinod Singh

Reputation: 138

Another option could be by changing the values in 'repository' table. It works pretty well in case of repository relocation.

Upvotes: 8

eMBee
eMBee

Reputation:

indeed, i just got stumped by the same dumb question. thanks. however it looks like the database information containing references to each commit in redmine is removed and then recreated as well. this can take a long time if your repository is large. (like the linux kernel)

Upvotes: 2

Danita
Danita

Reputation: 2514

Ok, I figured out. I created a dummy project with a dummy svn repo to test, and finally clicked that dreaded "Delete" link. It turns out it only deletes a reference to the repository, not the repo itself.

It was an admittedly dumb question, but this should be documented on the Redmine manual :)

Upvotes: 29

Related Questions