[Mailman-Users] Version Error with Migrated Lists?
Mark Sapiro
mark at msapiro.net
Thu Jan 19 20:24:18 CET 2012
Anthony Harrison wrote:
>
>Below is the dump (sans identifying information):
>
>[----- start pickle file -----]
><----- start object 1 ----->
[...]
> 'data_version': 97,
This is correct for Mailman 2.1.10 through 2.1.13
[...]
> 'member_posting_only': 1,
Should not be there.
[...]
> 'moderated': 0,
Should not be there.
[...]
> 'user_options': <removed>
> 'usernames': <removed>
Possibly you invertently removed it, but there should be
'useropts_version': 1,
If not, it isn't critical; it will just make versions.py do a bit of
extra work that should have no negative consequence, after which that
attribute will be set.
The problem is that the two attrubutes 'moderated' and
'member_posting_only' are Mailman 2.0 attributes that should not be in
Mailman 2.1 lists. If this was originally a Mailman 2.0 list, these
attributes should have been removed by versions.py when the list data
was upgraded to data_version 97. I have no idea or guess as to why
these attributes exist in these lists.
The fix for this problem is tricky. I have a withlist script to fix it,
but we can't use a withlist script without other measures because we
can't instantiate the list because of the data problem.
There are two 'easy' approaches to this. One is to run the withlist
script on the old server and then recopy the lists/LISTNAME/config.pck
files to the new server.
The other approach is to make sure Mailman is not running on the new
server and that no one is accessing the moved lists via the web. Then
add
DATA_FILE_VERSION = 97
to mm_cfg.py and run the withlist script and finally remove
DATA_FILE_VERSION = 97 from mm_cfg.py.
Here's the script to save in Mailman's bin/ directory with name
del_old.py
------------------------------------------------Cut
def del_old(mlist):
if not mlist.Locked():
mlist.Lock()
changed = False
if hasattr(mlist, 'moderated'):
del mlist.moderated
changed = True
if hasattr(mlist, 'posters'):
del mlist.posters
changed = True
if hasattr(mlist, 'member_posting_only'):
del mlist.member_posting_only
changed = True
if hasattr(mlist, 'forbidden_posters'):
del mlist.forbidden_posters
changed = True
if changed:
mlist.Save()
print 'list %s updated.' % mlist.real_name
mlist.Unlock()
------------------------------------------------Cut
Then run
bin/withlist -a -r del_old
to fix the lists.
--
Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
More information about the Mailman-Users
mailing list