Skip to content

REQUEA/svn2git

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized SVN to GitHub Migration Script

This script is designed to migrate SVN to GitHub repositories in private.

Requirements

  • Git account
  • Docker account

It uses the following tools:

  • curl to retrieve the list of SVN repositories
  • git for version control and pushing to GitHub
  • subversion for interacting with the SVN repositories
  • xmlstarlet to update the SCM section in the pom.xml file (if it exists)
  • git-svn for cloning SVN repositories as Git repositories
  • libc6-compat for compatibility with older librairies
  • github CLI to create and push Git repositories to GitHub
  • svn2git3(Ruby version) to convert SVN repositories to Git

How to Use

The script uses a configuration file (config.txt) to define the necessary environment variables.

Create a configuration file named config.txt with the following content:

SVN_USERNAME=<your_svn_username>
SVN2GIT_PASSWORD=<your_svn_password>
URL_SVN=<your_svn_url>
REPO_LIST="" # Add the names of the projects to REPO_LIST if needed.
GH_USERNAME=<your_github_username>
GH_EMAIL=<your_github_email>
GH_TOKEN=<your_github_token>
  • Replace <your_svn_username>, <your_svn_password>, <your_svn_url>, <your_github_username>, <your_github_email>, and <your_github_token> with your own credentials.
  • Leave <your_repo_list> empty to loop through all projects in the SVN URL or specify the targeted project names.

From Source

  1. Build the Docker image:
docker build -t svn2github .
  1. Run the Docker container:
docker run -d -v $(pwd)/config.txt:/config.txt svn2github

This command will run the container in the background and mount the config.txt file in the container.

DockerHub

mariebenitah/svn2github

docker pull mariebenitah/svn2github
docker run -d -v $(pwd)/config.txt:/config.txt mariebenitah/svn2github /config.txt

Limitations

This script has been tested with simple SVN repositories that use the standard trunk, tags, and branches layout. It may not work correctly with more complex SVN repositories or those that use a non-standard layout.

Additionally, this script does not migrate SVN authorization to GitHub. You may need to manually configure GitHub repository permissions after the migration.

This Dockerfile uses the ruby:3.0-alpine3.15 image as a base and installs the necessary tools and dependencies using apk. It then copies the svn2Github.sh script to the image, sets the script as the entrypoint, and grants execute permissions to the script.

Releases

No releases published

Packages

No packages published

Languages

  • Shell 92.9%
  • Dockerfile 7.1%