(Answering the questions inline below)

On Mon, Dec 23, 2024 at 9:26 AM Bo Berglund <bo.bergl...@gmail.com> wrote:

> On Sun, 22 Dec 2024 17:22:49 +0100, Daniel Sahlberg
> <daniel.l.sahlb...@gmail.com> wrote:
>
> >dsg@daniel-23:~/temp$ svn info file://`pwd`/repo_mirror
> >Path: repo_mirror
> >URL: file:///home/dsg/temp/repo_mirror
> >Relative URL: ^/
> >Repository Root: file:///home/dsg/temp/repo_mirror
> >Repository UUID: 2a340f81-40ba-467e-9d23-dc1940d0c4cb
> >Revision: 4
> >Node Kind: directory
> >Last Changed Author: dsg
> >Last Changed Rev: 4
> >Last Changed Date: 2024-12-22 16:53:01 +0100 (Sun, 22 Dec 2024)
> >
> >]]]
> >
> >Here comes the restore part. I'll start by dumping the mirror repository
> >from the first missing revision up to HEAD, please note the --incremental
> >option. If you want, you could pipe this through your favourite
> compression
> >program to get a slightly smaller dump file.
> >[[[
> >dsg@daniel-23:~/temp$ svnadmin dump --incremental repo_mirror -r
> 3:HEAD>dump
> >* Dumped revision 3.
> >* Dumped revision 4.
> >]]]
> >
> >Then on the main server I'll load the dump file. (You would obviously have
> >to transfer the dump file in some way from the mirror server to the main
> >server).
> >[[[
> >dsg@daniel-23:~/temp$ cat dump | svnadmin load repo_main
> ><<< Started new transaction, based on original revision 3
> >     * editing path : fil ... done.
> >
> >------- Committed revision 3 >>>
> >
> ><<< Started new transaction, based on original revision 4
> >     * editing path : fil ... done.
> >
> >------- Committed revision 4 >>>
>
> I have used the svn info to see the last revision of a repository in both
> the
> main server and the synced backup server. This way I have found the
> revision
> numbers to use.
>
> Then on the backup server I have used the svanadmin dump command as
> described to
> create the dump files, one fort each repository that had different last
> revision
> numbers.
>
> I have not yet done the last step to load the dump files into the main
> server.
>
> Questions:
>
> 1) When I run the "cat dump | svnadmin load repo_main command", will that
> be
> treated as a series of regular commits, which will trigger all the actions
> connected to a commit, like sending emails and such?
>

No, it shouldn't run any hooks when we load a dumpfile. However, there are
options in the `svnadmin load` command to let Subversion run the hooks:

  --use-pre-commit-hook    : call pre-commit hook before committing
revisions
  --use-post-commit-hook   : call post-commit hook after committing
revisions

Please note that this will affect only if your email notifications are set
up using the Subversion hooks on the same server. Otherwise they may be
sent anyway.


> 2) Is there a load command version where one specifies the file other than
> piping a cat to it? What happens with binary files in this cat operation?
>

Yes, there is an option to pass the path to the dumpfile instead:

  -F [--file] ARG          : read from file ARG instead of stdin

`svnadmin load -F dumpfile.dump` should work for you.

However, I'm not sure if it is available in the version 1.9.7. You may
check the help on your environment using the `svnadmin load --help`
command.

Also `cat` works badly with PowerShell, because it tries to convert the
encoding, which corrupts the dumpfile.

Thanks!

-- 
Timofei Zhakov

Reply via email to