On 3/27/07, Jonas Maurus <[EMAIL PROTECTED]> wrote: > > On Mar 26, 11:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > I apologize for the vague newbie question, but I'm gonna ask it > > anyway... > > > > I'd like to switch DBs from mysql to postgres... how does one do so? I > > assume one must export from mysql, import to postgres, then make the > > appropriate changes in settings.py, but are there any gotchas I should > > be aware of? Any advice on HOW to best do the export/import? Any > > advice at all for someone who's never done this? > > This is not easily done because the SQL-dialects of MySQL and > PostgreSQL differ. One thing that helped me is, when dumping data with > mysqldump, setting the compatibility mode to MySQL 3.23 so that > mysqldump produces neither character-set information nor "complex > inserts" (there is another command-line switch for that now, as far as > I remember). Then open the dump, strip out all CREATE TABLE statements > and execute those by hand on Postgres, fixing the data types along the > way (for example, int(...) becomes integer or bigint). Make sure that > you select the correct encoding when executing 'createdb'. > > Basically then you need to look at the errors that PostgreSQL will > undoubtedly spit in your general direction and fix them.
or you could use django fixture system to dump & restore the DB: 1) dump MySQL data 2) change settings to PostgreSQL db 3) run syncdb 4) load dumps 5) enjoy > > Good luck, > Jonas > > > > > -- Honza Kr�l E-Mail: [EMAIL PROTECTED] ICQ#: 107471613 Phone: +420 606 678585 --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---