On Tue, Mar 12, 2002 at 11:06:00AM -0500, Mark Matthews wrote:
> Hello,
> 
> I am moving a website that now resides on a i686 server running RedHat
> 6.2 with perl v5.005_03 to another i686 server running Suse 7.1 with
> perl v5.6.1.

> The website uses a number of cgi scripts that read and write from
> BerkeleyDB files using the tie function.
> 
> The site is currently running fine on the RedHat server, but when
> testing the scripts on the Suse box I am finding the the scripts are
> failing complaining that the db file cannot be opened.

> The function calling the script is as follows...
> $db = "blurb";
> tie(%BLURB, "DB_File", $db, O_RDONLY, 0664) || die("Error: could not
> open $db: $!\n");
> 
> Things I have tried so far..
> - I have checked that the BerkeleyDB file (blurb) in the right path, and
> is readable/writable.
> - I have checked  that the DB file is not corrupt by ftping it back to
> the RedHat box and testing it.. Works fine..
> - the command "file blurb" shows that the db file is Berkeley DB (Hash,
> version 5, native byte-order) and my guess is the version of DB_File
> cannot read that DB version.   I have installed earlier versions of
> DB_File on the Suse box with no luck.
> - I have successfully created a new db file using tie. The file created
> is version 7.
> 
> Since these scripts do infact work on the RedHat server, what do I need
> to do to get them to work on the Suse server

DB_File is usually implemented on top of whatever the latest Berkeley
DB is available.  The file formats are usually not compatible from
major version to another major version.  I believe RH 6.2 uses bdb v2
and Suse uses a newer version 3 or 3.1.  Use the rpm -q -a command to
find out which versions are which.

Anyway, you need to try out the db_upgrade command, it should upgrade
the db file to the latest format.  It might not be installed by
default, so check your local docs.  (I think it's in db3-utils, or
some such..)

You might also try out the BerkeleyDB module for access to more
interesting features provided by the later versions of this library.
In particular the transactions subsystem is very, very cool.

Good Luck

-- 
Paul Lindner    [EMAIL PROTECTED]   ||||| | | | |  |  |  |   |   |

    mod_perl Developer's Cookbook   http://www.modperlcookbook.org/
         Human Rights Declaration   http://www.unhchr.ch/udhr/

Reply via email to