Difference between revisions of "Install latest BSDDB"

From Gramps
Jump to: navigation, search
(Remove old BSDDB and replace with new)
Line 33: Line 33:
 
You can test with python test.py, but that does not work on my AMD64
 
You can test with python test.py, but that does not work on my AMD64
  
=== Remove old BSDDB and replace with new ===
+
=== Remove old BSDDB and replace with new in GRAMPS===
Not so sure yet on how this works.
+
* Go into the GRAMPS directory
I did the following:
+
* Open the following files:  
# Go into python directory: <pre>cd /usr/lib/python2.5/</pre>
+
/gramps-2.2.8/src/DbLoader.py
# Move old version: <pre>sudo mv bsddb bsddb_old</pre>
+
/gramps-2.2.8/src/Editors/_EditFamily.py
# Go where new version is installed: <pre>cd site-packages</pre>
+
/gramps-2.2.8/src/GrampsDb/_GrampsBSDDB.py
# Move new version to correct name: <pre>sudo mv bsddb3 bsddb</pre>
+
/gramps-2.2.8/src/GrampsDb/_GrampsDbBase.py
# Restart the PC. This is needed to make sure the old version is out of the memory when you run gramps (parts are preloaded by python, a commonly used scripting language).
+
/gramps-2.2.8/src/GrampsDb/_GrampsDBCallback.py
 +
/gramps-2.2.8/src/GrampsDb/_ReadGedcom.py
 +
/gramps-2.2.8/src/GrampsLogger/_ErrorReportAssistant.py
 +
/gramps-2.2.8/src/plugins/Leak.py
  
The above should be further tested !!!
+
* In these files, look up the line
 +
import bsddb
 +
:Change this line into
 +
import bsddb3
  
It does not work unless you do some changes in the bsddb3 source files.
 
  
It is not neccesary to do these steps if the following files in gramps are changed
+
'''The above should be further tested !!!'''
  
/gramps-2.2.8/src/DbLoader.py
 
 
/gramps-2.2.8/src/Editors/_EditFamily.py
 
 
/gramps-2.2.8/src/GrampsDb/_GrampsBSDDB.py
 
 
/gramps-2.2.8/src/GrampsDb/_GrampsDbBase.py
 
 
/gramps-2.2.8/src/GrampsDb/_GrampsDBCallback.py
 
 
/gramps-2.2.8/src/GrampsDb/_ReadGedcom.py
 
 
/gramps-2.2.8/src/GrampsLogger/_ErrorReportAssistant.py
 
 
/gramps-2.2.8/src/plugins/Leak.py
 
 
by replaceing all bsddb to bsddb3.
 
In this way bsddb and bsddb3 can coexist.
 
  
 
== Test ==  
 
== Test ==  
  
 
You should now have GRAMPS use the latest BSDDB version. Test if all works
 
You should now have GRAMPS use the latest BSDDB version. Test if all works

Revision as of 05:48, 28 May 2007

Some people have encountered bugs in GRAMPS which are due to the database not working good. Installing the lastest version of the BSDDB database tends to solve the problem.

Why install latest version ?

Some errors have happened in the past outside of GRAMPS, with the BSDDB database format GRAMPS uses. See eg:

It can be expected that recompiling BSDDB could solve the problem. However, if BSDDB needs to be recompiled, one can as well install the latest version.

Furthermore, the people of pybsddb recommond doing a local compile if the use of BSDDB is critical. For genealogists needing GRAMPS this could be considered true.

Before you begin: BACKUP

Take a backup of your genealogical data before you do this. Remember, you should backup data of GRAMPS in .gramps format, and keep that somewhere save (GRDB format is NOT a good backup format!).

Obtaining latest BSDDB version

BSDDB core from Sleepycat (Oracle)

Go to http://www.oracle.com/technology/software/products/berkeley-db/db/index.html and download latest libdb code, unpack. Read in the downloaded code the file docs/index.html on how to configure and make the code. For Linux, you need to into the dir /build_unix and configure, then compile with make, then do sudo make install.

Python BSDDB interface

Next, go to http://pybsddb.sourceforge.net Download bsddb3-4.5.0.tar.gz (version at the time of writing), unpack and go in the created directory. Run python setup.py, this should find your installed bsddb3 returning something like:

Found BerkeleyDB 4.5 installation.
  include files in /usr/local/BerkeleyDB.4.5/include
  library files in /usr/local/BerkeleyDB.4.5/lib
  library name is libdb-4.5
Now run python setup.py build to make the package, and lastly install it with
sudo python setup.py install
which installs bsddb3.

Note: you need libpython2.5-devel to build. You can test with python test.py, but that does not work on my AMD64

Remove old BSDDB and replace with new in GRAMPS

  • Go into the GRAMPS directory
  • Open the following files:
/gramps-2.2.8/src/DbLoader.py
/gramps-2.2.8/src/Editors/_EditFamily.py
/gramps-2.2.8/src/GrampsDb/_GrampsBSDDB.py
/gramps-2.2.8/src/GrampsDb/_GrampsDbBase.py
/gramps-2.2.8/src/GrampsDb/_GrampsDBCallback.py
/gramps-2.2.8/src/GrampsDb/_ReadGedcom.py
/gramps-2.2.8/src/GrampsLogger/_ErrorReportAssistant.py
/gramps-2.2.8/src/plugins/Leak.py
  • In these files, look up the line
import bsddb
Change this line into
import bsddb3


The above should be further tested !!!


Test

You should now have GRAMPS use the latest BSDDB version. Test if all works