Stop svn mirror work only on bitbucket

Hi,

we are using svn mirror in bitbucket for mirroring svn branches in bitbucket, and which is very helpful we are able to mirror every commits in svn as well as bitbucket,

for now, we are going to stop using svn,(means all our dev team is started using only Bitbucket, migrated everything into bitbucket using svn mirror) what are all the processes to follow?

just disable the mirror configuration and uninstall svn mirror from the repo, is that fine? , or anything I need to follow? please advise

Thanks,
Manju NS

Hello Manjunatha,

yes, that’s right, just stop the mirror and uninstall the add-on from the repository. The SVN and Bitbucket repositories will no longer be in sync after that and hence can be used separately.

nice, thanks for the confirmation

and , if i wanted to stop mirror only on some branches then how to do that ?

Thanks,
Manju NS

There is no way to partially stop the mirror, the Disable mirror stops the mirror at whole and the Uninstall button removes all the add-on metadata from the repository. The only way to get some branches mirrored and some not is to change the mirror configuration so that some of the branches are not mirrored, but the mirror itself is still running. There are three ways to have branches not mirrored with SVN:

  • if you don’t need those branches anymore , then they can be just excluded from the mirroring either by the excludeBranches feature or just by removing the appropriate part of the mapping configuration.
    Note that both those approaches cannot be applied on the fly and will require the full repository rebuild.

  • if, on the other hand, you need the branches to stay in the repository, but not to be mirrored, then probably the best way would be not to change existing mirrored branches, but created their copies in a not mirrored Git namespace instead. For example, if the SVN branches are set to be mirrored like this:

    [svn]
        …
        branches = branches/*:refs/heads/*
    

    which means the mirrored branches reside in heads namespace, then they can be copied to a regular Git branches that reside in another Git namespace, say, git_branches, so that those copied branches will reside in that new namespace:

    refs/git_branches
    

    and those new branches copies will not be mirrored to SVN as that new git_branches namespace is not included in the branches mapping configuration. Thus the mirror will continue to run while Git-only branches won’t be mirrored to SVN.

  • I must also mention another way to stop mirroring the branches, yet I must also warn you that this is not an intended way to do that, but rather a “hacking” way. It is possible to change the mapping configuration both in the regular configuration file (/subgit/config) but also in the running config (/subgit/.run/config) so that rebuild is not required. As an example, if you intend to stop mirroring all the branches, this line in the configuration might be commented or removed in both files:

    #branches = branches/:refs/heads/

    Key point here the same change must be made in both file and this will exclude this line from the mirror without rebuild. But I must warn you again, that this is not an intended way to change the configuration and it will only work well if all the branches are excluded and will not be added back to the mirror in the future, otherwise, this approach may break the mirror. Also note, that this can only work for some mapping lines removing only, adding new lines this way won’t work.

Thanks for the details

Thanks,

Manju NS