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]