[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: 1.1.0_rc2 update db version 4.2 on existing repositories

From: Max Bowsher <maxb_at_ukf.net>
Date: 2004-09-23 00:27:26 CEST

Jeff Kowalczyk wrote:
> Max Bowsher wrote:
>> The recommended procedure for moving between BDB versions is to
>> "svnadmin dump" using a svnadmin linked to the old bdb version, and
>> "svnadmin load" using a svnadmin linked to the new bdb version. There
>> are other ways in some circumstances, but this is the simple,
>> recommended, all-purpose way to do it.
>
> I'm taking your advice and trying to build a separate subversion-1.0.6
> (the last version used in which a commit was made) to do the 'svnadmin
> dump' step, then use the currently installed subversion-1.1.0_rc2 linked
> against BerkelyDB4.2 or fsfs to do the svnadmin load.
>
> Is there any way to tell which BDB version the repositor(ies) are
> expecting? I want to pass --with-berkelydb= to the 1.0.6 configure script.
>
> But the only information I have to go on is the error message:
>
> $ svnadmin dump acme
> svn: Berkeley DB error while opening environment for filesystem acme/db:
> Invalid argument
> svn: bdb: Program version 4.2 doesn't match environment version
>
> What does that 'environment version' refer to? I presume it isn't
> environment variables.

A berkeley DB 'environment' consists of the __db.* files which are mmaped
into processes using the database.

The version of BDB is coded into these.

> Below is the package file list for the various db4 versions installed on
> my system. What is the argument I should pass to ./configure
> --with-berkely-db= ?
>
> Alternatively, can I just use one of the existing db4 dump commands on the
> repository (how?), or is it mandatory to use 'svnadmin dump'? My
> repositories are all in /home/myuser/svn/repos1 , repos2 , etc.

Actually, it is possible to use the db_dump tools to get out of this
situation, without recompiling subversion.

It's a little fiddly though - read carefully! :-)

$ svnadmin create newrepos
$ cd newrepos/db
$ rm *s __db.* log.*

Yes, we really did intend to delete a huge chunk of the new repository!

$ cd ../..
$ cd oldrepos/db
$ for dbfile in *s; do
> db4.1_dump $dbfile | db4.2_load -h ../../newrepos/db $dbfile
> done

OK, we just used the fact that the database files are the only ones ending
in the letter s to iterate over them, transferring them from the old format
to the new format. I'm assuming your existing repositories are using db 4.1
here. Test this before hand by trying "db4_stat -e" and "db4.1_stat -e" (run
in directory oldrepos/db), and seeing which one works.

$ cd ../..
$ svnadmin verify newrepos

Assuming that worked, copy across your hooks, set up any permissions you
need, and it's done.

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Sep 23 00:28:00 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.