-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
56 lines (39 loc) · 1.57 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
This is a small monkey patch to add blob support to OFS.Image and File
This adds a new method called resave_to_blob that can be called on any Image
or File to save them as a blob to the filesystem instead.
This is my suggested upgrade script. It will convert all File and Image objects
for id, obj in container.ZopeFind(container, obj_metatypes=['File', 'Image'], search_sub=1):
resave_to_blob = getattr(obj, 'resave_to_blob', None)
if resave_to_blob is not None:
resave_to_blob()
return 'Done'
If you have a large database or a system where the above script could cause a timeout that would
cause problems I have created a script that you can run from zopectl
bin/zopectl run /path/to/upgrade_blob.py
The upgrade_blob.py file is part of the included files
The only requirements I know of is having zope 2.13 installed and working and blob support setup.
This patch should work on zope 2.12 also but I don't know for sure.
example zope.conf db section for blobs
<zodb_db main>
mount-point /
cache-size 5000
<zeoclient>
blob-dir /var/lib/zope2.12/blobs
shared-blob-dir true
server /var/lib/zope2.12/zeo/main/main.soc
storage 1
name main
var $INSTANCE/var
cache-size 0
</zeoclient>
</zodb_db>
example zeo.conf db section for blobs
<blobstorage 1>
<filestorage>
path $INSTANCE/var/Data.fs
</filestorage>
blob-dir /var/lib/zope2.12/blobs
</blobstorage>
A pure zope example I don't have right now.
The above setup with zeo makes it so that zope and zeo will share the same blob dir so that blobs
are not sent over zeo.