473,396 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Backing up objects in db file


Hi --

I have a program that stores all its data as pickled objects inside a
(berkeley) db file.

Having been bitten a couple of times when the format changed across linux
distribution upgrades, I'd like to write a simple program that dumps the
objects to some kind of text format, which can then be reconstituted into
objects later. It can't just dump out the pickle format, because that could
change between python versions.

There seem to be a few solutions in this space that nearly work - two
incomplete YAML implementations, and a similiar maturity XML thing. Does
anyone know of a solution that will both work, and is actively maintained ?

--
regards, chris
Jul 18 '05 #1
1 1226

Chris> I have a program that stores all its data as pickled objects
Chris> inside a (berkeley) db file.

Chris> Having been bitten a couple of times when the format changed
Chris> across linux distribution upgrades, I'd like to write a simple
Chris> program that dumps the objects to some kind of text format, which
Chris> can then be reconstituted into objects later. It can't just dump
Chris> out the pickle format, because that could change between python
Chris> versions.

Take a look at db2pickle.py and pickle2db.py in the Tools/scripts directory
of the source distribution. I have no idea if they are included in the
Windows installer. Here's the doc string from db2pickle.py:

Synopsis: db2pickle.py [-h|-g|-b|-r|-a] dbfile [ picklefile ]

Convert the database file given on the command line to a pickle
representation. The optional flags indicate the type of the database
(hash, btree, recno). The default is hash. If a pickle file is named it
is opened for write access (deleting any existing data). If no pickle
file is named, the pickle output is written to standard output.

Looking at that I can see I need to update the doc string. The flags mean:

-h - open as bsddb hash file
-g - open as gdbm file
-b - open as bsddb btree file
-r - open as bsddb recno file
-a - open using anydbm

Skip

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: mark | last post by:
Hi I'm hoping that some could point me in the right direction for "best practice" in: 1) securely backing up a complete sql7 and 2000 server containing many databases. 2) backing up an...
9
by: J. Frank Parnell | last post by:
hello, i dont know asp at all, but i have been asked to backup a database that is used on a site which uses .aspx. i dont need to do anything with it, just copy it and send it along to someone...
9
by: Jerry Porter | last post by:
Is there a way to back up the design changes in a SQL Server database without backing up all the data? It's just test data at this point.
3
by: war_wheelan | last post by:
I am having a problem backing up my database and TLog files due to a lack of local diskspace. The db file is about 30GB and the TLog is about 20GB each on a different hard disk. Each disk doesn't...
3
by: MLH | last post by:
I'm developing an app that I'd like to backup each time I open it for modifications. Is it too late to do so after opening the file with Access? Here's what I've been trying... Trevor Best posted...
1
by: Pavs | last post by:
This may not be the place to ask however i am looking for resources on how i may document data I am backing up from an oracle database to MS Access. Basically I have my oracle database and i...
0
by: Lyle Fairfield | last post by:
I have posted previously a procedure for backing up a remote MS-SQL db as text. This is a revised version in Javascript/JScript. This backups data and procedures as XML. My purpose in creating...
5
by: rdemyan via AccessMonster.com | last post by:
I have code in my front end that opens a form for backing up the front end. I'll give a brief description of what the form does: 1) When the backup form opens, it closes all open forms except for...
1
by: rob.w | last post by:
I am new to MySQL. I have an application using MySQL running on Windows Server 2000. If I were using Microsoft SQL Server 2000, I would need special software to back up an open SQL Server database....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.