There is need to migrate different subfolders under master and branches from SVN repository. But history is not coming properly.
Parent SVN Repo path: /ecdit/ (Attached is the screenshot - SVNParentRepo)
The path /ecdit/SVNToGITMig/ECDSurveillanceFeed/trunk needs to be the master and /ecdit/SVNToGITMig/ECDSurveillanceFeed/branches should be under branches.
The folders under SVNToGITMig earlier resided under a different location.
Below are the two mappings that we have tried-
SVN URL was set to https://svn.dts.fm.rbsgrp.net/ecdit/
Mapping 1
trunk = SVNToGITMig/ECDSurveillanceFeed/trunk:refs/heads/master
branches = branches//ECDSurveillanceFeed/trunk:refs/heads/
tags = tags//ECDSurveillanceFeed/trunk:refs/tags/
shelves = shelves//ECDSurveillanceFeed/trunk:refs/shelves/
This mapping generated on selecting the automatic configuraton layout during the add-on configuration.
Mapping 2
trunk = SVNToGITMig/ECDSurveillanceFeed/trunk:refs/heads/master
branches = SVNToGITMig/ECDSurveillanceFeed/branches/*:refs/heads/*
However, the history on bitbucket ,using both the mappings, is not complete. On bitbucket, we only see the history of one commit in the branch and two commits for master.
In svn, at /ecdit/SVNToGITMig/ECDSurveillanceFeed/trunk, we only see the hisory of one commit but at SVNToGITMig/ECDSurveillanceFeed/trunk/SurveillanceFeedProcess, we see entire history.
We are looking to get entire history from SVN.
Also attaching logs for the parent repo.
Bitbucket logs attached
SVN logs attached
gitlog_mapping1_master.txt (441 Bytes) gitlog_mapping1_master.txt (441 Bytes)
Hello.
Thank you for the logs.
Judging from them two commits for the ‘trunk’ is correct: the trunk directory has been added in r35031and edited once in r35047. It’s pretty strange that you can see something else for the “SVNToGITMig/ECDSurveillanceFeed/trunk/SurveillanceFeedProcess” directory. Could you please advise how to you check that directory history (with which Git command) and could it be possible to share Git log output for that directory?
According to the logs, there’s only one ECD5.0 branch; it’s been created from /Data/Archived/Application/ECD5.0, which has been created from /Data/Branches/Application/ECD5.0. To get the history add the latter to the mapping configuration:
trunk = SVNToGITMig/ECDSurveillanceFeed/trunk:refs/heads/master
branches = SVNToGITMig/ECDSurveillanceFeed/branches/*:refs/heads/*
branches = Data/Branches/Application/ECD5.0:refs/heads/oldecd5
Hi,
The directory history is available at svn side not on git.
Also, tried the provided mapping but the result is still the same.
Is there any documentation that we can follow to set the mappings? We have more then 20 repositories in similar structure and it would be helpful if we get some generic structure to follow as it would be tough to identify the previous folders for all of them.
Is it possible to setup a call to take a look at the current SVN repository structure and create the best possible way to migrate it?
Thanks
Hi,
Ok, got it, thanks for explanation, initially I had an impressions that you were talking about directory history in Git. So, the fact ‘master’ only shows two commits is expected, it actually have only two revisions in SVN, the one where it was created and the second where a directory was added. The add-on is unable to trace history of subdirectories individually, it only tracks history of a branch and in this case the branch only has two revisions.
I’m afraid, we don’t have a written documentation about history handling, mostly because there’s not that much to write about that. Virtually the only rule for the mapping is to add old branches directories names to handle the cases when directory were renamed formerly. That is, if a branch was added under the name “Name1”, then it was renamed to “Name2” and finally was renamed to “Name3” and under the “Name3” was added to mapping and translated to Git, then to have the whole history all three names should be added to the mapping. Note though, that it would only work if the renaming were performed by ‘svn move’, otherwise the add-on won’t be able to trace the history even if all the names are in the configuration.
I’m must note here, that add-on is able to recognise such renaming automatically – it does that when “Automatic Configuration” is chosen in “Automatic Configuration” section in the add-on settings. In this case, add-on reaches SVN server, scans its history and adds settings for all the renaming it finds in the history. So we usually recommend to use the auto configuration, it makes the best the add-on can to preserve the history and avoid errors in the repository.
For the branch history probably would worth adding the interim directory, too, so the configuration should look like this:
trunk = SVNToGITMig/ECDSurveillanceFeed/trunk:refs/heads/master
branches = SVNToGITMig/ECDSurveillanceFeed/branches/*:refs/heads/*
branches = Data/Archived/Application/ECD5.0:refs/heads/oldecd5
branches = Data/Branches/Application/ECD5.0:refs/heads/oldecd5_1
Thank you for the suggestions.
We have changed our approach a bit and now we are trying to refer to the original paths for migration.
Our intent is – We want to create a repository on git and for master branch , we want https://svn.dts.fm.rbsgrp.net/ecdit/Data/Production/Application/SurveillanceFeedProcess to appear SurveillanceFeedProcess as a folder under the master branch and then the content further under it.
Similarly, for branch, https://svn.dts.fm.rbsgrp.net/ecdit/Data/Archived/Application/ECD5.0 , there is a folder SurveillanceFeedProcess and the same should be visible on Git.
The final result should be, a git repository with name ECDSurveillanceFeed and the master branch should have SurveillanceFeedProcess folder and the history should be available for this folder and not for all the other folder under https://svn.dts.fm.rbsgrp.net/ecdit/Data/Production/Application . Similarly, a branch ECD5.0 on Git which has SurveillanceFeedProcess folder .
We tried the automatic configuration of add on but if we select the trunk path to be https://svn.dts.fm.rbsgrp.net/ecdit/Data/Production/Application , all other folders would also appear which is not required.
So, we selected https://svn.dts.fm.rbsgrp.net/ecdit/Data/Production/Application/SurveillanceFeedProcess as the trunk path and the mappings are listed below-
SVN url - https://svn.dts.fm.rbsgrp.net/ecdit
trunk = Data/Production/Application/SurveillanceFeedProcess:refs/heads/master
branches = SVNToGITMig/ECDSurveillanceFeed/branches//SurveillanceFeedProcess:refs/heads/
branches = Data/Branches/Application/ECD5.0/SurveillanceFeedProcess:refs/heads/Data/Application/ECD5.0
branches = SVNToGITMig/ECDSurveillanceFeed//SurveillanceFeedProcess:refs/heads/SVNToGITMig/ECDSurveillanceFeed/SurveillanceFeedProcess/
branches = Data/Branches/Application//Application/SurveillanceFeedProcess:refs/heads/Data/Application/
branches = Data/Archived/Application//SurveillanceFeedProcess:refs/heads/Data/Archived/
tags = tags//Production/Application/SurveillanceFeedProcess:refs/tags/
shelves = shelves//Production/Application/SurveillanceFeedProcess:refs/shelves/
But the result of this mapping is – subfolders of SurveillanceFeedProcess on both branch and master but not the folder itself. We want it to be displayed from SurveillanceFeedProcess level.
Repo Name = ECDSurveillanceFeed
Original SVN Location
Trunk = https://svn.dts.fm.rbsgrp.net/ecdit/Data/Production/Application/SurveillanceFeedProcess
Note: When we browse repo in GIT, We should be able to see the below structure under “master” branch
SurveillanceFeedProcess
Branch = https://svn.dts.fm.rbsgrp.net/ecdit/Data/Archived/Application/ECD5.0
Note: When we browse repo in GIT, We should be able to see feature branch by name “ECD5.0”. Under this folder, we should be able to see below structure
SurveillanceFeedProcess
Please let us know if it is possible to connect over a call for the same.
Hello.
So, you have these two directories in SVN:
svn.dts.fm.rbsgrp.net/ecdit/Data/Production/Application
svn.dts.fm.rbsgrp.net/ecdit/Data/Archived/Application/ECD5.0
both those directories contain a directory called SurveillanceFeedProcess
and you need that subdirectory to appear as a single directory with its content in master
and ECD5.0
git branches, is that correct?
If so, here is the configuration for such a setup:
[svn]
url = https://svn.dts.fm.rbsgrp.net/ecdit
trunk = Data/Production/Application:refs/heads/master
branches = Data/Archived/Application/ECD5.0:refs/heads/ECD5.0
includePath = /SurveillanceFeedProcess
createEmptyGitCommits = false
Please let me know if I got the intent wrong.
Hi,
Yes the understanding is correct.
We tried the mappings provided but below are the results-
The master branch has commit history from Data/Production/Application level and not just for SurveillanceFeedProcess.
For branch ECD5.0, only one commit is being displayed.
Thanks
Hi,
it looks I forgot to add one more line to keep the whole history of ECD5.0 branch, sorry for that, here is the configuration:
[svn]
url = https://svn.dts.fm.rbsgrp.net/ecdit
trunk = Data/Production/Application:refs/heads/master
branches = Data/Archived/Application/ECD5.0:refs/heads/ECD5.0
branches = Data/Branches/Application/ECD5.0:refs/heads/oldECD5.0
includePath = /SurveillanceFeedProcess
createEmptyGitCommits = false
Regarding the master
branch – yes, this is expected, it’s how the add-on works: it only trace history on branches level, it doesn’t trace every single directory in a branch.
Hi,
We are validating the suggested mappings and will update in case we have any issues.
Thanks
Hi,
With the suggested mapping, we do see SurveillanceFeedProcess as a folder under master branch but the history it has is from Data/Production/Application level. Is there a way we can just have the history of this folder and not all the folders?
Thanks
Hi,
I’m afraid that no, this is how the add-on work – it only traces history on a branch level, not on directories love. So in this configuration it is expected that is shows Data/Production/Application history.
Hi,
Regarding this case, we wanted to know if there is any pattern that is followed in selecting branch name when opting for automatic layout?
For example - When we opted for automatic layout for this migration, the list of mappings generated is as shown below-
trunk = Data/Production/Application/SurveillanceFeedProcess:refs/heads/master
branches = SVNToGITMig/ECDSurveillanceFeed/branches/*/SurveillanceFeedProcess:refs/heads/*
branches = Data/Branches/Application/ECD5.0/SurveillanceFeedProcess:refs/heads/Data/Application/ECD5.0
branches = SVNToGITMig/ECDSurveillanceFeed/*/SurveillanceFeedProcess:refs/heads/SVNToGITMig/ECDSurveillanceFeed/SurveillanceFeedProcess/*
branches = Data/Branches/Application/*/Application/SurveillanceFeedProcess:refs/heads/Data/Application/*
branches = Data/Archived/Application/*/SurveillanceFeedProcess:refs/heads/Data/Archived/*
tags = tags/*/Production/Application/SurveillanceFeedProcess:refs/tags/*
shelves = shelves/*/Production/Application/SurveillanceFeedProcess:refs/shelves/*
However, we do not see any specific pattern in which the branches are named for GIT. In one case, it is SVNToGITMig/ECDSurveillanceFeed//SurveillanceFeedProcess:refs/heads/SVNToGITMig/ECDSurveillanceFeed/SurveillanceFeedProcess/
In the other case, it is Data/Branches/Application//Application/SurveillanceFeedProcess:refs/heads/Data/Application/
We would like to know how the patterns for branch names are generated on the right hand side of the mapping(for git branch name).
Thanks