[svnadmin dump] Save, move or restore svn project history

Sometimes it’s interesting to move your svn project history to another server. In these cases the svnadmin tool is very useful.

To move or backup all your svn project history to a single file you have to do this:

prompt> svnadmin dump {repositoryfolder} > repositoryBackup.dump

In fact it’s possible to dump a specific range of revisions with the same command:

promopt> svnadmin dump {repositoryfolder} -r 1:299 > repositoryBackup.dump

The above sample has dumped revisions from 1 to 299. It’s also useful to discard latest updates or to branch a project.

Finally to restore the dumped file in a new server the only thing to do is to execute two commands, create and load:

prompt> svnadmin create /svn/directorio-repositorio
prompt> svnadmin load /svn/directorio-repositorio < repositorio.dump

Enjoy!

2 Responses to [svnadmin dump] Save, move or restore svn project history

  1. Manuel dice:

    I want to move only one project from an existing repository to other repository, which contains other projects. How do I move this project and all his history?

    Thanks for help.
    Manuel

  2. Pablo dice:

    mm that’s a different problem and I think you can’t do it with neither svnadmin dump nor other svnadmin tool. Anyways, have you tested to apply the command in a specific repository folder?

    Another way is to implement a little script to obtain a sequence of patch-files and comment-files for each revision and after that apply and commit them sequentially to the new repository. You even could store the comments but you’d lose the right and old commit-dates.

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

A %d blogueros les gusta esto: