17

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?

Montag451
  • 1,168
  • 3
  • 14
  • 30
Danita
  • 2,464
  • 4
  • 23
  • 29

6 Answers6

29

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 :)

Danita
  • 2,464
  • 4
  • 23
  • 29
  • 3
    Agreed, I'd like to change that so you can edit the repository but when you try to save it, Redmine will prompt you "In order to change the repository information, your existing repository data will be purged and reloaded. [OK] [CANCEL]" or similar. – Eric Davis Aug 19 '09 at 19:27
  • 2
    "delete" is a total misnomer. They need to fix this. – cmcginty Jan 14 '11 at 21:26
8

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

Vinod Singh
  • 138
  • 2
  • 5
  • which value should be specified in the column 'root_url' of 'repositories' table? Some instanses of redmine stripe one level from 'url' column, some 2 levels, and one instance I have tried makes it empty. – sergtk Jun 03 '11 at 12:47
3

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.

Omni5cience
  • 914
  • 8
  • 14
2

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';
dotancohen
  • 30,064
  • 36
  • 138
  • 197
2

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)

0

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';
Tono Wiedermann
  • 608
  • 6
  • 13