This should work.

python web2py.py -S yourapp -M
>>> db.export_to_csv_file(open('myfile.csv','w'))

exit shell, edit model to connect to other db

python web2py.py -S yourapp -M
>>> db.import_from_csv_field(open('myfile.csv','r'))
>>> db.commit()

It should work out of the both although this has not been tested much.
Let me know.

Massimo

On Mar 9, 2:01 pm, Joe  Barnhart <[email protected]> wrote:
> I think this is a good idea.  Can I use web2py's csv export/import to
> change databases under the covers?  I'm intrigued by the idea of
> exporting the whole database, creating a new one (with better
> referential integrity, etc.) and restoring it.  I think I'll give it a
> try as soon as the usage dies down next week.
>
> My application is a signup board for swim meets and the first one is
> being held next weekend -- busy busy busy this week followed by no
> traffic until the next meet.
>
> On Mar 9, 6:38 am, mdipierro <[email protected]> wrote:
>
> > For a production site I suggest using postgresql.
>
> > I have seen very bad failures of sqlite when for example you run out
> > of disk space. Complete database corruption.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to