Hi again.
On 20/09/2023 17:59, Stephen J. Turnbull wrote:
[...] I suspect that "DROP DATABASE mailmanweb;" and then loading the dumped database, followed by
mailman-web migrate
will work. (Usual caveat of you should have a backup onsite, a backup in a bank vault, and a backup store on the dark side of the moon before trying this!)
That exactly what I did in my initial attempt. It was a straight dump and restore which does as its first cmd "DROP DATABASE mailmanweb;"
As per https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/..., the migrate error was the table django_content_type already exists. Indeed it exists in the old database, but other tables do not (list owner & moderator, and other social media tables).
So if a mailman-web dpkg update also updated the database, then Debian's update clearly did not properly log the changes. Or maybe they were logged elsewhere like in /var/lib/mailman3 in the old machine which also needed to be carried over to the new - so updating on a new machine involved copying over not just the database, but some other files that provide db state?
[...]
After all, I would expect that an export of the archive to mbox, followed by a delete of the archive, followed by a hyperkitty_import of the archive, should leave you at the same place.
You would expect, for sure. You would be wrong, because mbox is a lossy format by design. (Or by lack of design, if you prefer.)
I'll stick with "whatever mechanism you provide to produce an export should include a mechanism that can import it".
It's like: Here is a way you can back up your data (through an mbox export), but by the way, the format we back it up in is broken so restores (mbox import) are not guaranteed.
That's just broken logic IMHO, especially since the "fix" in this case is so simple. Yes, mbox is broken in a multitude of ways, but if hyperkitty is going to produce an mbox export of a list that is stored in a database (i.e. it has to construct the mbox), hyperkitty ought to do so in a format that it can at least re-import. My 2 pence worth...
Of course this may all work for you, if you are using other backend combinations...
I should mention that I had to re-apply and rework some of my old patches back into Debian's libs. For example, update_index_one_list fails when using xapian with "Key too long" errors, so I had to re-apply the patch I contributed in https://gitlab.com/mailman/hyperkitty/-/issues/322.
Sad that I am now of the age where I search for an issue only to discover I provided a patch for it 2 years ago ;-(
-- Alex