A couple of things:

   1)  you should try using it in a shell and call it directly (not with 
web2py.py) :

            %> python cpdb.py ......

  2) there are  4 required parameters
       -f     path to source DB folder
       -F     path to target DB folder. I think you are missing this one.
       -y     source connection string (the DB you want to copy)
       -Y     target connection string (the new/copied DB). 

  3) if gluon is not in sys path, you can specify it using the -d option

  4) no quotes around args (unless you want a quoted string ;) ). So remove 
     the quotes around the values of the -y and -Y options

  5) I believe that your source DB should have migrate=False

an example:

    %> python cpdb.py -f ./applications/sviluppo/database -F applications/
sviluppo_2/database \
          -y sqlite://storage.sqlite -Y sqlite://storage2.sqlite -d 
../gluon 

    Tip: if you run the script from /web2py/scripts, you can use this 
relative path with the -d option
          to find dal.py

               %> python cpdb.py ... bla bla ... -d ../gluon


Hope this helps

Mart :)

On Wednesday, April 24, 2013 2:54:49 AM UTC-7, Rocco wrote:
>
> Hi all,
>
> I've some trouble trying to migrate an app db from mysql to postgres using 
> the cpdb.py script
>
> My appname is "sviluppo" and it has all the tables defined inside 
> "db_wizard.py".
> Both the connection url (source and dest) are tested working
>
> I used this command:
> ./web2py.py -S sviluppo -M  -R scripts/cpdb.py -A -f applications/sviluppo
> /databases \
> -y 'mysql://sviluppo:password@localhost/sviluppo' -Y 'postgres://
> web2py:[email protected]/sviluppo'
>
> But I get this error:
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.4.5-stable+timestamp.2013.03.18.22.46.22
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> MySQL(MySQLdb), PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), 
> Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)
> creating tables...
> EXCEPTION: could not make a copy of the database
> 'NoneType' object is not iterable
>
>
> The folder application/sviluppo/databases exists and it is not empy
>
> I also tryed to save to sqlite ( -Y 'sqlite://storage.sqlite') with same 
> failure.
>
> Any suggestions?
>
> Thanks, Rocco
>
>
>

-- 

--- 
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.


Reply via email to