manual: improve sqlite section

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-04-11 13:22:25 +02:00
parent d5853b5d65
commit 6505cdf957

View File

@ -198,7 +198,7 @@ monthly folders, and ignore every folder that is more than 2-3 months old,
this lets me only inspect a fraction of my Mails on every sync. If you haven't this lets me only inspect a fraction of my Mails on every sync. If you haven't
done this yet, do it :). See the folderfilter section in offlineimap.conf. done this yet, do it :). See the folderfilter section in offlineimap.conf.
3. The cache. 3. The sqlite cache.
+ +
OfflineImap caches the state of the synchronisation to e.g. be able to determine OfflineImap caches the state of the synchronisation to e.g. be able to determine
if a mail has been added or deleted on either side. if a mail has been added or deleted on either side.
@ -206,14 +206,14 @@ if a mail has been added or deleted on either side.
The historical status cache is a plain text file that writes out the complete The historical status cache is a plain text file that writes out the complete
file for each single new message (or even changed flag) to a temporary file. If file for each single new message (or even changed flag) to a temporary file. If
you have plenty of files in a folder, this is a few hundred kilo to megabytes you have plenty of files in a folder, this is a few hundred kilo to megabytes
for each mail and is bound to make things slow. The default status cache uses for each mail and is bound to make things slow. The latest default status cache
sqlite. This saves plenty of disk activity. The sqlite engine and the Python is sqlite. This saves plenty of disk activity. The sqlite engine and the Python
sqlite module must installed. See the status_backend = plain setting in the sqlite module must be installed. Enable the 'status_backend = plain' setting in
offlineimap.conf. 'offlineimap.conf' for legacy compatibility with versions prior to '6.4.0'.
+ +
If you switch the backend from plain to sqlite, you may want to delete the old If you switch the backend from plain to sqlite, you may want to delete the old
cache directory in <metadata>/Account-<account>/LocalStatus manually once cache directory in '<metadata>/Account-<account>/LocalStatus' manually (the
you are sure that things work. sqlite cache stands in the 'LocalStatus-sqlite' folder).
4. Use quick sync. 4. Use quick sync.
+ +
@ -233,37 +233,6 @@ you can set this to True. If you set it to False, you lose some of that
safety, trading it for speed. safety, trading it for speed.
Upgrading from plain text to SQLite cache format
------------------------------------------------
OfflineImap uses a cache to store the last known status of mails (flags etc).
Historically that has meant plain text files, but recently we introduced
sqlite-based cache, which helps with performance and CPU usage on large
folders. Here is how to upgrade existing plain text cache installations to
sqlite based one:
1. Sync to make sure things are reasonably similar.
2. Change the account section to "status_backend = sqlite".
3. Run a new sync.
+
This will convert your plain text cache to an sqlite cache (but leave
the old plain text cache around for easy reverting). This must be quick and
not involve any mail up/downloading.
4. See if it works! :-)
5. If it does not work, go back to the old version or set "status_backend = plain"
6. Delete the old text cache files.
Once you are sure it works, you can delete the
~/.offlineimap/Account-foo/LocalStatus folder (the new cache will be in the
LocalStatus-sqlite folder)
Security and SSL Security and SSL
---------------- ----------------