Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Conversion of DB files Berkley DB v3.0 to newest version

538197Oct 8 2006 — edited Nov 2 2006
Dear specialist of Berkley BD,

I have a veritable problem created by my hosting provider and I need the friend advice.

The provider have move to new data center and change all software for « newest versions » , including Berkley DB .

But my site was created by one programmer in 2001 / 2002 (« don’t visible now» ) . He use probably the version 3.0. This DB play the role not biggest, but important: document's title and heading . The programmer leave just one tools of conversion of .txt file to .db. file (db_load.exe, libdb32.dll, loadtree.bat).

In the new data center this DB can’t open. The hosting provider (à mon avis peu compétent en Berkley) make just this remarque about problem :

« Since we are running a newer version of berkley db on our new servers something things may have changed which are giving you errors. Try exporting your old data from your berkley db on europa.your-site.com to a flat file and then importing it to the new berkley db which is running on your current account.”

I have « .txt » file for the conversion , but i’m not programmer in my life and I try to find one solution for conversion of this file to DB file compatible with “newest version”.

This is PHP code of function for generates HTML code of document's title and heading..

function TitleAndHeading()
{
// global $_SERVER['DOCUMENT_ROOT'];

// Try to open database file containing site's tree.
$DBHandle = dba_open($_SERVER['DOCUMENT_ROOT'] . '/_internals' . RLS_LANGUAGE . 'sitetree.db', 'r', 'db3');

if ($DBHandle)
{
// Try to retrieve string containing document's heading and title.
$Document = dba_fetch(RLS_URI, $DBHandle);

if ($Document === FALSE)
{
$Document = array('', '');
// MailError(__FILE__, __LINE__, 'dba_fetch()');
}
else
{
// These substrings are delimited by TAB character.
$Document = explode("\t", $Document);

// Title is optional. If it is absent it is considered the same as heading.
if (sizeof($Document) < 2)
{
$Document[RLS_TITLE] = &$Document[RLS_HEADING];
}
}

dba_close($DBHandle);
}
else
{
$Document = array('', '');
// MailError(__FILE__, __LINE__, 'dba_open()');
}

return $Document;
}

Thank you for you help. Cordialy,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2006
Added on Oct 8 2006
1 comment
1,161 views