Folks,
I needed to migrate my previously-sqlite based mailman core to mariadb, and have more or less managed it, though I feel certain the table schema I ended up with is not what mailman would have created for itself.
Is there any way to get a copy of the mysql/mariadb table schema that I can then pour the existing data into (i.e. I don't want to reinitialise the db)?
Thanks,
Ruth
-- Software Manager & Engineer Tel: 01223 414180 Blog: http://www.ivimey.org/blog LinkedIn: http://uk.linkedin.com/in/ruthivimeycook/
- Ruth Ivimey-Cook (ruth@ivimey.org) [211015 20:54]:
Is there any way to get a copy of the mysql/mariadb table schema that I can then pour the existing data into (i.e. I don't want to reinitialise the db)?
I had the same problem (but with postgresql) and ended with creating another database and installed mm3 into that.
Andi
Ruth Ivimey-Cook writes:
Is there any way to get a copy of the mysql/mariadb table schema that I can then pour the existing data into (i.e. I don't want to reinitialise the db)?
I suspect you alread know this, but the backend database schema is entirely implicit in the SQLAlchemy models. There is no function in Mailman to dump out the backend schema, although SQLAlchemy may have one. AAAAaaaannnnddd ... bingo!
https://docs.sqlalchemy.org/en/14/faq/metadata_schema.html#how-can-i-get-the...
Don't know if that does what you need, but it's the best I can come up with without reading tons of code. :-) There's probably a similar function that allows you to dump all the data in an SQLAlchemy-specific format that you can load back in to a different backend and SQLAlchemy will do the schema translation.
Also, have you considered that Django keeps an independent set of tables for HyperKitty and/or Postorius? Same comments apply, except that Django has its own ORM.
https://docs.djangoproject.com/en/3.2/ref/django-admin/#dumpdata
Finally, don't the backend databases have some sort of "dump schema" command? That might be more useful. Note that I got lucky (yay, Google-fu!) with "DBM dump schema" on the first try so "dump" seems to be the right search term.
participants (3)
-
Andreas Barth
-
Ruth Ivimey-Cook
-
Stephen J. Turnbull