[greenstone-devel] Re: Where is archives.inf?

From Anupama of Greenstone Team
DateMon Feb 16 16:56:58 2009
Subject [greenstone-devel] Re: Where is archives.inf?
In-Reply-To (009601c98d4e$4cf8f780$e6eae680$-gov-ar)
Hello Diego,

While I use GLI to delete documents from Greenstone and therefore am not
familiar with the procedure you use (editing archives.inf), I hope the
following may help you to view and edit these two new ldb files:

1. Open an x-term and go to your Greenstone building directory. If
you're using GS2, this will be the top level GS2 installation folder, if
you're using GS3 it will be the folder called "gs2build".

2. From this folder, run "setup.bat" if you're on Windows, or run
"source setup.bash" if you're on Linux.
This will allow you to run the programs db2txt and text2db.

3. Now go into your Greenstone's collect folder (the one containing the
ldb files).

a. IMPORTANT: Make backup copies of both your ldb files
(archiveinf-src.ldb and archiveinf-doc.ldb). I don't want this
experiment to ruin anything.

b. To view the contents of the ldb file, run:
db2txt archiveinf-doc.ldb
(and db2txt archiveinf-src.ldb)

You may want to pipe the generated text out to a text file in order to
be able to edit the contents.

For example, imagine naming the converted database files doc.txt and

db2txt archiveinf-doc.ldb > doc.txt
db2txt archiveinf-src.ldb > src.txt

This will convert your database files into text and write them out to 2
new files called doc.txt and src.txt. This way, can edit the contents of
the database and save the text files with the changes.

In your case, you would be deleting the affected lines from both the
text versions of the archiveinf-doc and archiveinf-src databases that
you just generated. You must use your own discretion here to determine
which lines to delete. As I am not used to manually deleting documents
from Greenstone, I cannot yet advise you in this. Do not forget to save
your changes to the text files.

c. Finally, you will want to reconvert the textfiles back into the
database files. Type the following in your terminal/command console window:
txt2db archiveinf-doc.ldb < doc.txt
txt2db archiveinf-src.ldb < src.txt

d. If anything failed after the database files had been replaced by
their edited versions, then put the original ldb database files back in
place (the ones you had backed up in step 3a above).

I hope the above was not too confusing and can help you. Tell us if it
does not work.

Diego Spano wrote:
> Hi you all.
> Yesterday I download a nightly snapshot for windows. After importing a
> few docs I found that archives.inf file was replaced by two ldb files:
> archiveinf-src.ldb and archiveinf-doc.ldb. Obviously, these are not text
> files. When I wanto to delete a doc from Greenstone I delete its folder
> from archives and also delete the related line inside archives.inf file.
> But now, how should I edit the ldb file to delete the record?.
> Thanks
> Diego Spano