Bitbucket Server How-To
- 1. Import Subversion repository
- 1.1 Create Git repository
- 1.2 Go to Subversion Mirror settings
- 1.3 Specify the details
- 1.4 Adjust branch mapping
- 1.5 Adjust translation settings
- 1.6 Adjust authors mapping
- 1.7 Adjust connection settings
- 1.8 Start import
- 2. Mirror Subversion repository
- 2.1 Create Git repository
- 2.2 Go to Subversion Mirror settings
- 2.3 Specify the details
- 2.4 Adjust branch mapping
- 2.5 Adjust translation settings
- 2.6 Adjust authors mapping
- 2.7 Adjust connection settings
- 2.8 Enable Mirror
- 2.9 Unsynced commits
- 3. Rest API
1. Import Subversion repository
In this chapter the one-time import process is described.
1.1 Create Git repository
SVN Mirror Add-on is not involved in those few very first steps. Just create a project if you don’t have one yet.
Now you need to enter your new project and create an empty Git repository there. You can also use an existing repository, conflicts would be available for manual resolving.
Give a name to your repository and click Create Repository button.
1.2 Go to Subversion Mirror settings
When you are on an empty repository page, click Actions button in the upper left corner.
By clicking on the button you will get to the Subversion Mirror page.
1.3 Specify the details
Specify Subversion URL:
You can specify Subversion credentials as username/password, SSH private key or SSL client certificate. Add-on might also use Subversion authentication cache.
Choose your way of dealing with branches and tags translation. You may configure it manually, you may not bother if all you have is a single directory.
You could also try doing it automatically - you’ll need to specify the ‘trunk’ directory, that is the main branch directory in the SVN repository, e.g. ‘trunk’, ‘develop’ or ‘branches/main’. Add-on will explore the history of this branch and find all other branches automatically. Keep in mind, this process might take a while.
Specify the default e-mail domain for authors mapping. It would be used for the SVN authors which don’t have any match in local and global authors mapping configuration.
And press Continue
1.4 Branch mapping
If additional branch mapping is needed you may easily specify it on the first tab with an example of mapping provided.
1.5 Adjust translation settings
There are four options of how authors mapping will be going on.
At first, you could specify matches manually at Authors Mapping tab. If this wouldn’t be present or there should be no match, add-on will try to find Git authors using SVN username among registered users. If that wouldn’t be the case, global authors mapping scheme is to be used. You can also change your default e-mail domain here.
By following the global authors mapping link you’ll get to the Global Subversion Mirror Settings. Here in the similiar text field you can specify global authors mapping settings which would work for all of your repositories.
Find more details on authors mapping and SVN credentials processing at dedicated documentation page.
Translation settings could be set if you ran the import at least for one time. You can specify the start revision and decide if you need to track changes in .gitattributes or .gitignore files.
1.6 Adjust authors mapping
Here you can describe your custom mapping with an example in the field provided. Don’t forget to turn it on by setting the Use Repository Authors Mapping option on (it will be enabled by default, just make sure it’s still there).
1.7 Adjust connection settings
Here you can change the SVN URL, or add and change credentials you would like to use. You can also set the interval for polling Subversion for some changes. Set to zero it would say to the system to wait for your request.
1.8 Start import
Finally, click Import button. The progress bar will start. Import process may take a while depending on the size of SVN repository and your connection to SVN server. SVN Mirror updates header as soon as import is done. Now you have Git repository with contents of specified Subversion repository and you can use it as a regular Git repository.
After the import is done you can turn you imported repository into the mirror anytime by simply clicking the Enable button.
Prerequisites: Using this manual you would be able to create a mirror or to make an one-time import for your SVN project. You should be Repository Administrator in order to mirror SVN repository to Git.
2. Mirror Subversion repository
This chapter is dedicated to the mirroring feature of SVN Mirror Add-on.
2.1 Create Git repository
SVN Mirror Add-on is not involved in those few very first steps. Just create a project if you don’t have one yet.
Now you need to enter our new project and create an empty Git repository there. You can also use an existing repository, conflicts would be available for manual resloving.
Give a name to your repository and click Create Repository button.
2.2 Go to Subversion Mirror settings
When you are on an empty repository page, click Actions button in the upper left corner.
By clicking on the button you will get to the Subversion Mirror page.
2.3 Specify the details
Specify Subversion URL:
You can specify Subversion credentials as username/password, SSH private key or SSL client certificate. Add-on might also use Subversion authentication cache.
Choose your way of dealing with branches and tags translation. You may configure it manually, you may not bother if all you have is a single directory.
You could also try doing it automatically - you’ll need to specify the ‘trunk’ directory, that is the main branch directory in the SVN repository, e.g. ‘trunk’, ‘develop’ or ‘branches/main’. Add-on will explore the history of this branch and find all other branches automatically. Keep in mind, this process might take a while.
Specify the default e-mail domain for authors mapping. It would be used for the SVN authors which don’t have match in local and global authors mapping configuration.
And press Continue
2.4 Branch mapping
If additional branch mapping is needed you may easily specify it on the first tab with an example of mapping provided.
2.5 Adjust translation settings
There are four options of how authors mapping will be going on.
At first, you could specify matches manually at Authors Mapping tab. If this wouldn’t be present or there should be no match, add-on will try to find Git authors using SVN username among registered users. If that wouldn’t be the case, global authors mapping scheme is to be used. You can also change your default e-mail domain here.
By following the global authors mapping link you’ll get to the Global Subversion Mirror Settings. Here in the similiar text field you can specify global authors mapping settings which would work for all of your repositories.
Find more details on authors mapping and SVN credentials processing at dedicated documentation page.
Translation settings could be set if you ran the import at least for one time. You can specify the start revision and decide if you need to track changes in .gitattributes or .gitignore files.
2.6 Adjust authors mapping
Here you can describe your custom mapping with an example in the field provided. Don’t forget to turn it on by setting the Use Repository Authors Mapping option on (it will be enabled by default, just make sure it’s still there).
2.7 Adjust connection settings
Here you can change the SVN URL, or add and change credentials you would like to use. You can also set the interval for polling Subversion for some changes. Set to zero it would say to the system to wait for your request.
2.8 Enable Mirror
Finally, click Mirror button to enable the mirror. The progress bar will start. Initial import process may take a while depending on the size of SVN repository and your connection to SVN server.
SVN Mirror updates header as soon as import is done. Now you have Git repository synchronized with specified Subversion repository and you can use it as a regular Git repository. You will see changes committed to SVN in your Git repository and vice versa.
After synchronisation is finished, mirroring is turned on. You can switch it off and turn it on again any time you want. Commits pushed to Git while the mirror was switched off would be marked as unsynced and would be presented on the related tab.
You can change configuration, connection settings, authors mapping any time you want.
2.9 Unsynced commits
In case your Git repository was not completely empty before initial import started, you’ll get new tab where you could resolve occured commit conflicts.
3. Rest API
SVN Mirror Add-On for Bitbucker Server provides a number of REST API end points that could be used to control configured mirrors. For more details, please see the related article.