Backing up a repository using SVNKit

View: New views
2 Messages — Rating Filter:   Alert me  

Backing up a repository using SVNKit

by Mark Hewitt-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Are there any examples of SVNKit classes that can provide backup and restore features for a repository?
In scripting, I find that "svnadmin hotcopy" works for me, but this does not seem to have a representation in the SVNKit interfaces.
I do see SVNAdminClient.doDump() which could be what I should use, but it is certainly not as simple !

Mark J Hewitt
Principal Software Architect
_____________________________
Lawson Software
Movex House
Old Power Way
Lowfields Business Park
Elland
West Yorkshire
United Kingdom
HX5 9DE

Work:+(44) (0)1422 377611 ext: 42876
Fax:   +(44) (0)1422 310109
http://www.lawson.com

-------------------- Internet e-Mail Disclaimer --------------------
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient you are notified that any use, disclosure, copying or distribution of the information is prohibited. In such case, you should destroy this message and kindly notify the sender by reply e-mail. The views expressed in this e-mail and any attachments are personal and, unless stated explicitly, do not represent the views of Lawson Software.

Re: Backing up a repository using SVNKit

by Alexander Sinyushkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Mark,

You may backup your repository by making a dump file (svnadmin dump)
that can be loaded to a pristine repository (svnadmin load).
With SVNAdminClient it is analogous to using doDump() and doLoad()
methods. Their parameters are just the same as those of svnadmin util.

doDump(File repositoryRoot, OutputStream dumpStream, SVNRevision
startRevision, SVNRevision endRevision, boolean isIncremental, boolean
useDeltas)

in doDump you specify a source repository root (repositoryRoot)?
dumpStream (where the source repository will be dumped),
[startRevision, endRevision] - is a revision range to dump
isIncremental and useDeltas - are similar to svnadmin dump's
--incremental and --deltas switches.

When you got your dumpStream, you should pass it as input stream to

doLoad(File repositoryRoot, InputStream dumpStream, boolean
usePreCommitHook, boolean usePostCommitHook, SVNUUIDAction uuidAction,
String parentDir)

where repositoryRoot is the root of a pristine repository,
usePreCommitHook is similar to svnadmin load's --use-pre-commit-hook switch
usePostCommitHook - to svnadmin load's --use-post-commit-hook switch
uuidAction - to svnadmin load's --ignore-uuid switch
parentDir -  to svnadmin load's --parebt-dir switch

----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

Mark Hewitt wrote:

>
> Are there any examples of SVNKit classes that can provide backup and
> restore features for a repository?
> In scripting, I find that "svnadmin hotcopy" works for me, but this does
> not seem to have a representation in the SVNKit interfaces.
> I do see SVNAdminClient.doDump() which could be what I should use, but
> it is certainly not as simple !
>
> Mark J Hewitt
> Principal Software Architect
> _____________________________
> Lawson Software
> Movex House
> Old Power Way
> Lowfields Business Park
> Elland
> West Yorkshire
> United Kingdom
> HX5 9DE
>
> Work:+(44) (0)1422 377611 ext: 42876
> Fax:   +(44) (0)1422 310109
> http://www.lawson.com
>
> -------------------- Internet e-Mail Disclaimer --------------------
> This e-mail and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to which they
> are addressed. If you are not the intended recipient you are notified
> that any use, disclosure, copying or distribution of the information is
> prohibited. In such case, you should destroy this message and kindly
> notify the sender by reply e-mail. The views expressed in this e-mail
> and any attachments are personal and, unless stated explicitly, do not
> represent the views of Lawson Software.