tag:blogger.com,1999:blog-556483990291343818.post1231304076161968697..comments2022-03-31T05:57:15.730-07:00Comments on Web, cloud, storage & more: [solved] Move django from SQLite to MySQLInokshttp://www.blogger.com/profile/12772156423368779651noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-556483990291343818.post-34176299827490143472016-03-01T02:38:54.309-08:002016-03-01T02:38:54.309-08:00This comment has been removed by the author.Ajeeb.K.Phttps://www.blogger.com/profile/01115763216408946723noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-52224212032888586872015-03-01T14:32:42.241-08:002015-03-01T14:32:42.241-08:00From your idea, with slight modification as follow...From your idea, with slight modification as following, we are able to copy data to another database with a custom Django script<br />1. Use apps.get_app_configs() to retrieve all models instead of using ContentType.<br />2. Sort models using sort_dependencies in dumpdata command<br />3. Add method to copy tables in ManyToManyFields (The value for primary key might be different, refer to the source code for explanation)<br />Please see http://codeforaliving.blogspot.com/2015/03/migrating-django-database-from-one.html for detailsAnonymoushttps://www.blogger.com/profile/01342185292316522478noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-19840148823024062692013-04-08T12:21:27.994-07:002013-04-08T12:21:27.994-07:00Please post full traceback errorPlease post full traceback errorInokshttps://www.blogger.com/profile/12772156423368779651noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-9512653171306433162013-04-08T07:49:11.499-07:002013-04-08T07:49:11.499-07:00I keep getting
"django.db.utils.DatabaseErro...I keep getting<br /><br />"django.db.utils.DatabaseError: no such table: django_content_type"<br /><br />I check mysql and table has been created Anonymoushttps://www.blogger.com/profile/02707758599827864950noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-10143981110102334072013-02-27T04:42:09.932-08:002013-02-27T04:42:09.932-08:00There a trouble with all that method.
As Prasenji...There a trouble with all that method. <br />As Prasenjit Singh mention - ManyToManyFields are not copied at all.Inokshttps://www.blogger.com/profile/12772156423368779651noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-70439576451439614072013-02-26T01:58:34.735-08:002013-02-26T01:58:34.735-08:00Here is a more manual method. Supports defining th...Here is a more manual method. Supports defining the order in which the tables are copied.<br /><br />https://gist.github.com/runekaagaard/5037369Rune Kaagaardhttps://www.blogger.com/profile/07800212942929410345noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-5050220828398130622013-02-12T01:05:35.057-08:002013-02-12T01:05:35.057-08:00yes, there is a problem this m2m fields. I'll ...yes, there is a problem this m2m fields. I'll think about the solutions.Inokshttps://www.blogger.com/profile/12772156423368779651noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-40064056427048331192013-02-08T04:55:04.823-08:002013-02-08T04:55:04.823-08:00One thing I'd like to ask is how should one mo...One thing I'd like to ask is how should one move ManyToManyFields? Using the above method, everything works like a charm except ManyToManyFields. Anonymoushttps://www.blogger.com/profile/02422000255061247967noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-23403308848904288232012-10-21T23:46:04.801-07:002012-10-21T23:46:04.801-07:00As quick solution - you can run that script twice ...As quick solution - you can run that script twice :)Inokshttps://www.blogger.com/profile/12772156423368779651noreply@blogger.comtag:blogger.com,1999:blog-556483990291343818.post-25800012315103362572012-10-20T09:39:49.956-07:002012-10-20T09:39:49.956-07:00Thanks a lot. Your post was really helpful.
But o...Thanks a lot. Your post was really helpful.<br /><br />But one minor thing. Even with this, I first got integrity errors. So, instead of ContentType.objects.all(), I tweaked the order in which data is copied from various tables. Then it worked.Anonymousnoreply@blogger.com