Re: Help converting from mysql to postgres
I cannot claim any DBA credentials so be careful reading further.
I use dumpdata successfully with lots of --exclude=djkgd.sdsghg options
only for testing fixtures. I have tried a few times and failed to get it
working transferring between two Postgres databases.
I use postgres dump and load for that purpose. It is reliable and easy.
I can show you my scripts for that if you want.
Maybe you can use MySQL dump and edit the output to look like the
Postgres dump then load that?
Maybe someone has written converter?
Mike
On 19/05/2013 8:47am, frocco wrote:
> I am getting
>
> IntegrityError: duplicate key value violates unique constraint
> "catalog_pricing_pkey"
> DETAIL: Key (id)=(8) already exists.
>
> catalog_pricing_id_seq
> Start Value 8
> Last Value 1
> Increment 1
>
>
> There are 8 records in table. id 1 through 8
>
> If I reset sequence, last value is set to 1
> if I restart sequence, last value is set to 8
>
> On Saturday, May 18, 2013 1:23:04 PM UTC-4, frocco wrote:
>
> Hello
>
> Here are my steps.
>
> python manage.py dumpdata --database=legacy > data.json
>
> python manage.py loaddata data.json --database=default
>
> IntegrityError: Problem installing fixture 'data.json': Could not
> load accounts.UserProfile(pk=17): duplicate key value violates
> unique constraint "accounts_userprofile_user_id_key"
> DETAIL: Key (user_id)=(17) already exists.
>
> In the mysql table, there is only one record with user_id 17
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home