Subversion レポジトリの移転

Subversionのレポジトリをサーバマシン間で移動させる必要があって、前のときはどうやったかなぁ、と思い出しつつ作業。(ということで、次回のためにメモ。。)

結局、dumpしてloadするしかないか、ということで、コマンドのヘルプを表示させながら(笑

% svnadmin help dump
dump: usage: svnadmin dump REPOS_PATH [-r LOWER[:UPPER]] [--incremental]

Dump the contents of filesystem to stdout in a 'dumpfile'
portable format, sending feedback to stderr.  Dump revisions
LOWER rev through UPPER rev.  If no revisions are given, dump all
revision trees.  If only LOWER is given, dump that one revision tree.
If --incremental is passed, then the first revision dumped will be
a diff against the previous revision, instead of the usual fulltext.

Valid options:
  -r [--revision] ARG      : specify revision number ARG (or X:Y range)
  --incremental            : dump incrementally
  --deltas                 : use deltas in dump output
  -q [--quiet]             : no progress (only errors) to stderr

ということなので、

svnadmin dump PATH --incremental

でファイルにダンプ。もっとも、

% svndumpfilter help exclude
exclude: Filter out nodes with given prefixes from dumpstream.
usage: svndumpfilter exclude PATH_PREFIX...

Valid options:
  --drop-empty-revs        : Remove revisions emptied by filtering.
  --renumber-revs          : Renumber revisions left after filtering.
  --skip-missing-merge-sources : Skip missing merge sources.
  --preserve-revprops      : Don't filter revision properties.
  --quiet                  : Do not display filtering statistics.

のほうを利用してごみをついでに消してしまう、という手はあったけど、めんどくさいのでそのまま。

loadは、同じく

% svnadmin help load
load: usage: svnadmin load REPOS_PATH

Read a 'dumpfile'-formatted stream from stdin, committing
new revisions into the repository's filesystem.  If the repository
was previously empty, its UUID will, by default, be changed to the
one specified in the stream.  Progress feedback is sent to stdout.

Valid options:
  -q [--quiet]             : no progress (only errors) to stderr
  --ignore-uuid            : ignore any repos UUID found in the stream
  --force-uuid             : set repos UUID to that found in stream, if any
  --use-pre-commit-hook    : call pre-commit hook before committing revisions
  --use-post-commit-hook   : call post-commit hook after committing revisions
  --parent-dir ARG         : load at specified directory in repository

ということで、

cat dumpfile.dump | svnadmin load .

で。

すでにチェックアウトしている手元のレポジトリは、

svn switch --relocate FROM TO

で書き換える。

Leave a Reply »