Trying to migrate from svn to git on a slow machine is an impossible mission. If the svn repo has enough records, it will constantly error out for various reasons.

My first attempt was to dump the entire repo to a local file, reload it into a local svn server, and clone it into a git repo:

# Dump to local file.
svnrdump dump https://svn-remote/trunk/drupal > drupal.dump

# Create a new svn repo locally.
svnadmin create drupal

# Load the dump file into the new repo.
svnadmin load drupal < drupal.dump

# Clone the local svn repo into a git repo.
git svn clone --prefix=svn/ --no-metadata --authors-file=../users.txt file://${PWD}/svns/drupal ./gits/drupal -t tags -b branches --trunk=trunk/drupal

# Add the git remote.
git remote add origin git@git-remote:org/drupal.git

# Push our new master to remote.
git push -u origin master

However, the git clone kept erroring out around the 3000th commit. It was also taking over an hour so this was all probably due to a slow machine.

The next attempt worked much better. Instead of creating a local svn to clone from, it initializes a new git with an svn remote so we can fetch from the remote. If it fails, we can try fetching again which causes it to continue from where it left off:

# Create a new directory where we can initialize our new repo.
mkdir gitdir && cd gitdir

# Initialize the svn repo.
git svn init https://svn-remote/trunk --no-metadata --prefix=svn/ --trunk=trunk/drupal

# Set the authors file so names are mapped correctly.
git config svn.authorsfile ../users.txt

# Fetch all svn commits.
git svn fetch

# Add git remote.
git remote add origin git@git-remote:org/drupal.git

# Push our new master to remote.
git push -u origin master

If new commits are added to SVN, we can do one of two things. If we have changes in git that we want to keep, we can just merge the svn changes:

git svn fetch
git merge svn/trunk

If, however, we want to mirror svn with git, we can just reset the git repo to the svn remote:

git svn fetch
git reset --hard svn/trunk

That’s it!