Re: [greenstone-devel] Problem with 2.51 built from source onFreeBSD

From John R. McPherson
DateThu, 02 Sep 2004 10:18:26 +1200
Subject Re: [greenstone-devel] Problem with 2.51 built from source onFreeBSD
In-Reply-To (41364674-5080407-bellsouth-net)
On Thu, 2004-09-02 at 10:00, Beth Nicol wrote:

> I'll find out from my ISP/Hosting service what kind of machine it is
> one. Question: If it is an "endian" problem, then if I can't use the
> index built on the Redhat linux on x86, then I should be able to use the
> index built on a PowerBook or IMac under OSX - right?

Yes, that's right, assuming it's an endian problem. Another possibility
is that the freebsd machine is the same endian, but has a significantly
different version of the GDBM libraries that can't open those files.
We've never heard of that happening before, however...

> I should only have to copy over the etc, index, images folders? Or do I
> need the metadata folder as well?

The gdbm file is stored in the index folder, along with the compressed
text and text indices, so just etc/ index/ and images/ are required to
serve up a built collection.

> I rebuilt the demo collection on the FreeBSD box, and it works now. My
> "real" collection is just to large and the build too intensive to build
> on a shared server, so I was trying to build it on my own hardware and
> just move the collection.
>
> Thanks. I'll be back with more information.

There is another way - greenstone comes with two small utilities:
db2txt and txt2db. These will respectively read and write the gdbm
files. So, you could dump the database on your linux machine to a
(large) text file like:

$ db2txt (collection)/index/text/(collection).ldb > $HOME/gdbm.txt
then scp that gdbm.txt file over to the freebsd machine, and then
on that machine (after running greenstone's setup.bash or setup.csh)
$ txt2db (collection)/index/text/(collection).bdb < gdbm.txt

(ldb means little-endian db file, bdb means big-endian).

John McPherson