Some of the information here may be outdated, please check the book instead

Currently in trunk only - will be in web2py 1.55:

You can now export and import the entire database in CSV:

for table in db.tables: db[table].truncate()

The CSV contains all tables. Notice that upon import, the imported records may have different ID numbers than the original ones but references will not be broken because web2py will use the new IDs and not the old IDs for references.

This is independent on the database back-end, therefore you can export, for example, from a Oracle database, and import in PostgreSQL.

Works will all web2py supported databases including the Google App Engine. In this latter case you cannot do IO on filesystem so you must use a memory mapped file:

for table in db.tables: db[table].truncate()
© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.