Re: Use migrations api to create a command for data migration between different databases

2016-06-14 Thread Bruno Ribeiro da Silva
I agree with you Shai, that's why I proposed a command that makes use of migrations internals (not to use a migration per se) to do the job. Thanks for the feedback Marc, I know having the migration to use django orm is a much slower process than importing it from a textual source, but the main ob

Re: Use migrations api to create a command for data migration between different databases

2016-06-14 Thread Shai Berger
Hi Bruno, I think that putting such an operation in a migration doesn't make much sense. If it's part of the project migrations, it means that the canonical way to set up the database is to start up on MySQL and move to PG later. This is almost surely not what you intend. Copying data across

Re: Use migrations api to create a command for data migration between different databases

2016-06-14 Thread Marc Tamlyn
I'd suggest your approach is also quite slow. Andrew Godwin did something similar once at a lower level - see https://github.com/lanyrd/mysql-postgresql-converter (use at your own risk) On 10 June 2016 at 19:44, Bruno Ribeiro da Silva wrote: > The problem here is that this works well for small d

Re: Use migrations api to create a command for data migration between different databases

2016-06-10 Thread Bruno Ribeiro da Silva
The problem here is that this works well for small databases, but for bigger ones it uses too much memory and is a slow process. On Fri, Jun 10, 2016 at 3:22 PM, Stephen J. Butler wrote: > I usually just use dumpdata/loaddata to do these kinds of things. > > On Fri, Jun 10, 2016 at 12:47 PM, Bru

Re: Use migrations api to create a command for data migration between different databases

2016-06-10 Thread Stephen J. Butler
I usually just use dumpdata/loaddata to do these kinds of things. On Fri, Jun 10, 2016 at 12:47 PM, Bruno Ribeiro da Silva < bruno.dev...@gmail.com> wrote: > Hey guys, I'm not sure if I should be asking this here, but it's related > to django internals. > > I have this idea to create a command th

Use migrations api to create a command for data migration between different databases

2016-06-10 Thread Bruno Ribeiro da Silva
Hey guys, I'm not sure if I should be asking this here, but it's related to django internals. I have this idea to create a command that uses the migrations api to migrate all the data from one database (eg. MySQL) to another database (PostgreSQL). So I would run the migrations in the new targe