I assume you're getting this from the "web2py Application Development 
Cookbook". Note, there is no -N option -- that's just an error in the book. 
As for the code, in mover.py, try changing:

*[field for field in table]

to:

*[field.clone() for field in table]

The DAL will no longer let you simply re-use an existing field in other 
tables -- you must instead clone it.

Anthony

On Saturday, July 21, 2018 at 6:26:33 PM UTC-4, Gualter Portella wrote:
>
> Hi everyone,
>
> I've been trying to move my sqlite database to a nysql database for 
> production.
>
> I've been trying the recipe, but get only two responses:
>
> 1) when I type the following command on the command line :
>
> (User) C:\Users\Lenovo\Documents\git>python web2py.py -S site -M -N -R 
> applications\site\private\mover.py
> Usage: python web2py.py
>
> web2py.py: error: no such option: -N
>
> 2) when I ommit the option -N, I get:
>
> (User) C:\Users\Lenovo\Documents\git>python web2py.py -S site -M -R 
> applications\site\private\mover.py
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2018
> Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
> Database drivers available: pg8000, pyodbc, psycopg2, imaplib, sqlite3, 
> pymysql
> creating tables...
> Traceback (most recent call last):
>   File "C:\Users\Lenovo\Documents\git\gluon\shell.py", line 274, in run
>     execfile(startfile, _env)
>   File "C:\Users\Lenovo\Documents\git\gluon\shell.py", line 42, in execfile
>     exec(code, global_vars, local_vars)
>   File "applications\site\private\mover.py", line 27, in <module>
>     main()
>   File "applications\site\private\mover.py", line 7, in main
>     other_db.define_table(table._tablename,*[field for field in table])
>   File "C:\Users\Lenovo\Documents\git\gluon\packages\dal\pydal\base.py", 
> line 586, in define_table
>     table = self.lazy_define_table(tablename, *fields, **args)
>   File "C:\Users\Lenovo\Documents\git\gluon\packages\dal\pydal\base.py", 
> line 598, in lazy_define_table
>     table = table_class(self, tablename, *fields, **args)
>   File 
> "C:\Users\Lenovo\Documents\git\gluon\packages\dal\pydal\objects.py", line 
> 363, in __init__
>     field.bind(self)
>   File 
> "C:\Users\Lenovo\Documents\git\gluon\packages\dal\pydal\objects.py", line 
> 1672, in bind
>     'Field %s is already bound to a table' % self.longname)
> ValueError: Field auth_user.id is already bound to a table
>
>
> The new database is empty. How come auth_user.id is already bound to a 
> table. I do not get it
>
> Any help is greatly appreciated.
>
> Cheers,
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to