I have deleted a list (list@nog.ke) - list_id = list.nog.ke. I can see from Django Admin UI that the archives are still intact. I created a new list (list@lists.nog.ke) - list_id = list.lists.nog.ke Is there a way to move the archives from the old list to the new list?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 5/2/24 03:42, Odhiambo Washington wrote:
I have deleted a list (list@nog.ke) - list_id = list.nog.ke. I can see from Django Admin UI that the archives are still intact. I created a new list (list@lists.nog.ke) - list_id = list.lists.nog.ke Is there a way to move the archives from the old list to the new list?
Change the name
and list_id
in the list's entry in the
hyperkitty_mailinglist
table in the database. If there is already an
entry there for the new list, delete it
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Thu, May 2, 2024 at 8:11 PM Mark Sapiro <mark@msapiro.net> wrote:
On 5/2/24 03:42, Odhiambo Washington wrote:
I have deleted a list (list@nog.ke) - list_id = list.nog.ke. I can see from Django Admin UI that the archives are still intact. I created a new list (list@lists.nog.ke) - list_id = list.lists.nog.ke Is there a way to move the archives from the old list to the new list?
Change the
name
andlist_id
in the list's entry in thehyperkitty_mailinglist
table in the database. If there is already an entry there for the new list, delete it
mysql> select id, name, list_id from hyperkitty_mailinglist;
+----+----------------------------+----------------------------+
| id | name | list_id |
+----+----------------------------+----------------------------+
| 1 | skunkworks@lists.my.co.ke | skunkworks.lists.my.co.ke |
| 2 | list@nog.ke | list.nog.ke |
| 3 | eanog@lists.my.co.ke | eanog.lists.my.co.ke |
| 4 | isoc@lists.my.co.ke | isoc.lists.my.co.ke |
| 5 | kazi@lists.my.co.ke | kazi.lists.my.co.ke |
| 6 | kenog@lists.my.co.ke | kenog.lists.my.co.ke |
| 7 | mechanics@lists.my.co.ke | mechanics.lists.my.co.ke |
| 8 | science@lists.my.co.ke | science.lists.my.co.ke |
| 9 | security@lists.my.co.ke | security.lists.my.co.ke |
| 10 | vmware_tech@lists.my.co.ke | vmware_tech.lists.my.co.ke |
| 11 | water@lists.my.co.ke | water.lists.my.co.ke |
| 12 | wordpress@lists.my.co.ke | wordpress.lists.my.co.ke |
| 13 | list@lists.nog.ke | list.lists.nog.ke |
+----+----------------------------+----------------------------+
13 rows in set (0.00 sec)
mysql> delete from hyperkitty_mailinglist where id = 13;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key
constraint fails (`mailmansuite`.`hyperkitty_mailinglist_owners`,
CONSTRAINT `hyperkitty_mailingli_mailinglist_id_a47e04ec_fk_hyperkitt`
FOREIGN KEY (`mailinglist_id`) REFERENCES `hyperkitty_mailinglist` (`id`))
Is there an easier way? I need to delete id=13 then rename id=2
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 5/3/24 03:59, Odhiambo Washington wrote:
On Thu, May 2, 2024 at 8:11 PM Mark Sapiro <mark@msapiro.net> wrote:
On 5/2/24 03:42, Odhiambo Washington wrote:
I have deleted a list (list@nog.ke) - list_id = list.nog.ke. I can see from Django Admin UI that the archives are still intact. I created a new list (list@lists.nog.ke) - list_id = list.lists.nog.ke Is there a way to move the archives from the old list to the new list?
Change the
name
andlist_id
in the list's entry in thehyperkitty_mailinglist
table in the database. If there is already an entry there for the new list, delete itmysql> select id, name, list_id from hyperkitty_mailinglist; +----+----------------------------+----------------------------+ | id | name | list_id | +----+----------------------------+----------------------------+ | 1 | skunkworks@lists.my.co.ke | skunkworks.lists.my.co.ke | | 2 | list@nog.ke | list.nog.ke | | 3 | eanog@lists.my.co.ke | eanog.lists.my.co.ke | | 4 | isoc@lists.my.co.ke | isoc.lists.my.co.ke | | 5 | kazi@lists.my.co.ke | kazi.lists.my.co.ke | | 6 | kenog@lists.my.co.ke | kenog.lists.my.co.ke | | 7 | mechanics@lists.my.co.ke | mechanics.lists.my.co.ke | | 8 | science@lists.my.co.ke | science.lists.my.co.ke | | 9 | security@lists.my.co.ke | security.lists.my.co.ke | | 10 | vmware_tech@lists.my.co.ke | vmware_tech.lists.my.co.ke | | 11 | water@lists.my.co.ke | water.lists.my.co.ke | | 12 | wordpress@lists.my.co.ke | wordpress.lists.my.co.ke | | 13 | list@lists.nog.ke | list.lists.nog.ke | +----+----------------------------+----------------------------+ 13 rows in set (0.00 sec) mysql> delete from hyperkitty_mailinglist where id = 13; ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`mailmansuite`.`hyperkitty_mailinglist_owners`, CONSTRAINT `hyperkitty_mailingli_mailinglist_id_a47e04ec_fk_hyperkitt` FOREIGN KEY (`mailinglist_id`) REFERENCES `hyperkitty_mailinglist` (`id`))
Is there an easier way? I need to delete id=13 then rename id=2
There are several tables that reference the hyperkitty_mailinglist table by id. These are hyperkitty_email, hyperkitty_mailinglist_owners, hyperkitty_mailinglist_moderators and hyperkitty_thread. Ideally, you wouldn't have created the list@lists.nog.ke before updating the hyperkitty_mailinglist entry, but now, do the following:
update hyperkitty_email set mailinglist_id = 2 where mailinglist_id = 13;
update hyperkitty_mailinglist_owners set mailinglist_id = 2 where
mailinglist_id = 13;
update hyperkitty_mailinglist_moderators set mailinglist_id = 2 where
mailinglist_id = 13;
update hyperkitty_thread set mailinglist_id = 2 where mailinglist_id = 13;
delete from hyperkitty_mailinglist where id = 13;
update hyperkitty_mailinglist set name = 'list@lists.nog.ke', list_id =
'list.lists.nog.ke' where id = 2;
If there have been no posts to the list@lists.nog.ke list the updates of hyperkitty_email and hyperkitty_thread won't do anything, and likewise the update of hyperkitty_mailinglist_moderators if the list has no moderators
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
update hyperkitty_email set mailinglist_id = 2 where mailinglist_id = 13; update hyperkitty_mailinglist_owners set mailinglist_id = 2 where mailinglist_id = 13; update hyperkitty_mailinglist_moderators set mailinglist_id = 2 where mailinglist_id = 13; update hyperkitty_thread set mailinglist_id = 2 where mailinglist_id = 13; delete from hyperkitty_mailinglist where id = 13; update hyperkitty_mailinglist set name = 'list@lists.nog.ke', list_id = 'list.lists.nog.ke' where id = 2;
Or instead of that you could just go to the new list@lists.nog.ke archive in HyperKitty and delete it and then just do the
update hyperkitty_mailinglist set name = 'list@lists.nog.ke', list_id =
'list.lists.nog.ke' where id = 2;
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Fri, May 3, 2024 at 11:48 PM Mark Sapiro <mark@msapiro.net> wrote:
Mark Sapiro wrote:
update hyperkitty_email set mailinglist_id = 2 where mailinglist_id = 13; update hyperkitty_mailinglist_owners set mailinglist_id = 2 where mailinglist_id = 13; update hyperkitty_mailinglist_moderators set mailinglist_id = 2 where mailinglist_id = 13; update hyperkitty_thread set mailinglist_id = 2 where mailinglist_id = 13; delete from hyperkitty_mailinglist where id = 13; update hyperkitty_mailinglist set name = 'list@lists.nog.ke', list_id = 'list.lists.nog.ke' where id = 2;
Or instead of that you could just go to the new list@lists.nog.ke archive in HyperKitty and delete it and then just do the
update hyperkitty_mailinglist set name = 'list@lists.nog.ke', list_id = 'list.lists.nog.ke' where id = 2;
I went with this approach and worked super! Thank you.
So, seeing as deleting a list retains its archives, if I want to delete a list together with its archives, do I first delete the archives, then follow with the list?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 5/4/24 01:31, Odhiambo Washington wrote:
So, seeing as deleting a list retains its archives, if I want to delete a list together with its archives, do I first delete the archives, then follow with the list?
It is better to delete the list first from Mailman core and then from HyperKitty. The order doesn't matter except if you delete from HyperKitty first and the hourly new_lists_from_mailman job runs before you delete the list from Mailman, HyperKitty will create a new, empty archive for the list.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Mark Sapiro
-
Odhiambo Washington