Did you try from shell:
python web2py.py -S app -M -P
>>>> db.export_to_csv_file(open('backup.csv','wb'))
exit and change DAL('sqlite:....') to DAL('postgres:...')
python web2py.py -S app -M -P
>>>> db.import_to_csv_file(open('backup.csv','rb'),id_map={})
It will not preserve the IDs but it should fix all references.
On Friday, 11 October 2013 19:14:43 UTC-5, François Delpierre wrote:
>
> Hi,
>
> For performance reason I would like to migrate my DB from sqlite to
> postgreSQL DB.
> What's the best way to do it.
> I spent some time with the export
> / db.import_from_csv_file(open('somefile.csv', 'rb')) and I just feel like
> I'm loosing my time for 2 hours.
> After trying to fix various problems, now I notice that all my keys are
> wrong, so the db.import_from_csv does not keep the id values, and so
> completely break the application.
>
> What is the recommended way to migrate from sqlite to an other DB (without
> breaking the application)?
>
> Thanks,
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.