Friday, October 22, 2010

Re: moving from Postgres to MySQL

hm seriously... why not use Django 1.2 and multidb? It is very easy not?

conf two dbs, default is your postgres db, I'll call db2 your mysql db and you assert that you did a syncdb in both...

so for each model you do:

for item in Model.objects.all(): item.save(using='db2',force_insert=True)

Probably you just need to do it :), isn't beautiful, but similar stuff worked for me on a project.

Convert a SQL file from mysql <-> postgres, (and inverse) is a little painfull... but you can do with sed scripts or vim, I really prefer django multi db  :)

2010/10/22 ringemup <ringemup@gmail.com>
Not spectacular, but mysqldump has flags that can increase the chances
of portability, and one would hope pg_dumpall does too. I figured
something like that might be worth a try before you write a custom
migration script.

On Oct 22, 2:58 am, Chris Withers <ch...@simplistix.co.uk> wrote:
> On 21/10/2010 15:40, ringemup wrote:
>
> > MySQL has a tool (mysqldump) that will output the contents of an
> > entire database to a SQL file that can then be loaded directly into
> > another database.  Does Postgres not have anything analogous?
>
> Sure, pg_dumpall. Now, what're the chances of the SQL that spits out
> being parsed correctly by MySQL without complaint? ;-)
>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
>             -http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Felipe 'chronos' Prenholato.
Linux User nº 405489
Home page: http://chronosbox.org/blog
Twitter: http://twitter.com/chronossc
Use http://1l.to to shrink your urls :)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment