This post originated from an RSS feed registered with Python Buzz
by Carlos de la Guardia.
Original Post: Packing the ZODB offline
Feed Title: I blog therefore I am
Feed URL: http://blog.delaguardia.com.mx/feed.atom
Feed Description: A space to put my thoughts into writing.
While working for a client, I had the need to transfer the Data.fs file from the customer's server to my development machine, but I was not authorized to pack the database.
Due to other commitments I was working at night, so I would have to miss a whole day of work on this project if I waited for someone else to pack the db the next day. The file's size was 14GB so transfering it as it was really was out of the question.
I had a regular user ssh acount, so there were a couple of ways available for me to pack a copy of the ZODB, but the Python interpreter seemed to me to be the easiest path to success:
Done! The file shrunk from 14GB to 360MB and the transfer was done in time for me to get some work done that night.
In case anyone wonders about this, the referencesf parameter is part of the storage interface and is required for the pack method, even though apparently FileStorage doesn't use it in any way. If you are curious, referencesf is a function that returns the ids of objets inside a pickle. If you want to know still more, then you've got me. This is as far as I'm willing to go.