Have you tried Massimo's new script?

I've been unexpectedly busy in the last few days, but I hope to have
time to complete wrapping that script in argparse this evening (or
tomorrow) which will have just a few more options that I have found
useful (ie. truncate, delete db, copy model, etc.). With or without
argparse, its pretty sweet!

from his posting (May 23)

"
title:  script to clone a database


http://code.google.com/p/web2py/source/browse/scripts/cpdb.py
Usage:
   python web2py.py -S app -M -N -R scripts/cpdb.py -A 'sqlite://
other_db.sqlite'
It will copy all data from current db to other_db (sqlite or
not)
The -A argument can be any URI string for
example
   'mysql://username:password@localhost/
dbname'
"

hope it helps!

Mart :)


On May 30, 2:33 pm, pbreit <pbreitenb...@gmail.com> wrote:
> I don't understand the question. Do you want to share the same DB from two
> different apps?
>
> I suppose you could copy the models and then set your DB connection strings
> to point to the same DB. In one app set migrate=False. You might even be
> able to symbolically link the models from one app to the other.
>
> The DAL can work standalone so you could put it in a module, Web2py's
> site_packages or anywhere in your Python path.
>
> If you use it outside it's normal location, include "from gluon.dal import
> *" at the top of your files and then you should be able to do all the same
> things (db = DAL(..., db.define_table(...).
>
> You mentioned exporting which is quite 
> different.http://web2py.com/book/default/chapter/06?search=Exporting-and-Import...
>
> Might need to understand more completely what you are trying to do.

Reply via email to