Changes

Jump to: navigation, search

Install latest BSDDB

166 bytes added, 04:25, 23 December 2020
m
no edit summary
Some people have encountered bugs in GRAMPS Gramps which are due to the database not working goodwell.  Installing the lastest latest version of the [[Gramps_Glossary#bsddb|BSDDB ]] database tends to solve the problem. '''This guide is for version {{version}} of Gramps, for earlier versions, you need to manually change python files!''' == Why install the latest version ? ==Some errors have happened in the past outside of Gramps version 2.2.x, with the [[Category:Developers/GeneralDatabase_Backends#BSDDB_Backend|BSDDB database]]format Gramps used. See Bugs: {{bug|110}} and {{bug|814}}
== Why It can be expected that recompiling BSDDB could solve those problems. However, if BSDDB needs to be recompiled, one might as well install the latest version ? ==Some errors have happened in the past outside of GRAMPS, with the BSDDB database format GRAMPS uses. See eg:* http://bugs.gramps-project.org/view.php?id=1010* http://bugs.gramps-project.org/view.php?id=814
It can be expected that recompiling BSDDB could solve Furthermore, the people of PyBSDDB (the Python "bindings" project for the problem. However, Oracle Berkeley DB) recommend doing a local compile if the use of BSDDB needs to be recompiled, one can as well install the latest versionis critical.
Furthermore, the people of pybsddb recommond doing a local compile if the use of BSDDB is critical. For genealogists needing GRAMPS this Gramps, a stable database could certainly be considered truea critical need.
== Before you begin: BACKUP ==
 Take a backup of your genealogical data before you do this. Remember, you should backup data of GRAMPS 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/technologytechnetwork/softwaredatabase/productsdatabase-technologies/berkeley-dbberkeleydb/dbdownloads/index.html and download latest libdb codewithout encryption (eg Berkeley DB 6.1.23.NC.tar.gz ), unpack. You need to create an Oracle ID for this, but it is OSS software. 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 <code>:  cd build_unix ../build_unix<dist/code> and configure, then compile with make, then do <code> sudo make install</code>.
=== Python BSDDB interface ===
Next, go to [http://www.jcea.es/programacion/pybsddb.htm pybsddb] ([http://pybsddb.sourceforge.net ]).Download <code>the version compatible with the downloaded bsddb version, eg [http://pypi.python.org/pypi/bsddb3-/5.1.1 bsddb3 5.1.1] is tested with 4.2 and 5.01.tar.gz</code> (version at the time of writing), unpack Unpack and go in the created directory. Run <code>python setup.py</code>, this should find your installed bsddb3 returning something like:
Found BerkeleyDB 4Berkeley DB 5.5 1 installation. include files in /usr/local/BerkeleyDB.45.51/include library files in /usr/local/BerkeleyDB.45.51/lib library name is libdb-45.51
Now run <code>python setup.py build</code> to make the package, and lastly install it with <pre>sudo python setup.py install</pre> which installs bsddb3.
Note: you need libpython2.5x-devel to build.You can test this, with x your version of python test.py, but that does not work on my AMD64
=== Remove old BSDDB and replace with new ===Not so sure yet on how this works. I did the following:# Go into python directory: <pre>cd /usr/lib/python2.5/</pre># Move old version: <pre>sudo mv bsddb bsddb_old</pre># Go where new version is installed: <pre>cd site-packages</pre># Move new version to correct name: <pre>sudo mv bsddb3 bsddb</pre># Restart the PC. This is needed to make sure the old version is out of the memory when you As a test, run gramps (parts are preloaded by python, a commonly used scripting language).
The above should be further tested !!! python >>> import bsddb3 >>> bsddb3.__version__ '5.1.1' >>> bsddb3.db.version() (5, 1, 19)
It does not work unless === Make Gramps use bsddb3===In version {{stable_branch}}, you do some changes in can make Gramps use the bsddb3 source filespackage by setting a config key.For this, open the ini file:
It is not neccesary to do these steps if the following files in ~/.gramps are changed/gramps{{stable_branch}}/gramps.ini
/gramps-2.2.8/src/DbLoader.pyand look for the line
/gramps ;;use-2.2.8/src/Editors/_EditFamily.pybsddb3=False
/gramps-2.2.8/src/GrampsDb/_GrampsBSDDB.pyChange this line into
/gramps use-2.2.8/src/GrampsDb/_GrampsDbBase.pybsddb3=True
/gramps-2If you now start Gramps, bsddb3 will be used.2.8/src/GrampsDb/_GrampsDBCallback.py
/gramps-2.2.8/src/GrampsDb/_ReadGedcom.py
== See also ==*[[Database Formats]] - Gramps*[[Database Backends]] - user selectable beginning with the Gramps 5 version == External Link ==Information on BSDDB (Python "bindings" for Oracle Berkeley DB)*[http://www.jcea.es/grampsprogramacion/pybsddb.htm Jesus Cea -2Official maintainers Site for BSDDB]*[http://docs.python.org/library/bsddb.html bsddb — Interface to Berkeley DB library — Python v2.6.1 documentation]*[http://pybsddb.2sourceforge.8net/srcref/GrampsLoggerintro/_ErrorReportAssistantdata.pyhtml Berkeley DB Reference Guide: An introduction to data management]
[[Category:Developers/gramps-2.2.8/src/plugins/Leak.py by replaceing all bsddb to bsddb3.In this way bsddb and bsddb3 can coexist. == Test ==  You should now have GRAMPS use the latest BSDDB version. Test if all worksGeneral]]
4,530
edits

Navigation menu