Copy data from one db into another

165 views
Skip to first unread message

Dave Carlson

unread,
Jul 17, 2013, 5:06:39 AM7/17/13
to web...@googlegroups.com
Using the provided script cpdb.py and following the outlined procedure in the documentation (http://web2py.com/books/default/chapter/29/06#Copy-data-from-one-db-into-another

I get the following error 

 creating tables...
EXCEPTION: could not make a copy of the database
'NoneType' object is not iterable

in this particular case, I've been using sqlite to build up a wiki and want to migrate the data to MariaDB, which I have installed, it is working and it is functioning correctly. Opening, connecting and I have used another app to interact with the database, before I attempted this copying process.

Any suggestions?

Thanks
Dave

mart

unread,
Jul 19, 2013, 3:30:33 AM7/19/13
to web...@googlegroups.com
can you provide the exact cmd line that you used as well as the full output displayed in your shell ?

Thanks,
Mart

Dave Carlson

unread,
Jul 19, 2013, 4:50:45 AM7/19/13
to web...@googlegroups.com
Hi Mart,

this is the entirety of what I'm inputting and getting back in my shell on the command line. Minus the actual username and password for my setup of course.

[ dave@andromeda(0.18,) 4:45:37am ] /home/www-data/web2py
$ sudo python scripts/cpdb.py -f applications/Wikispots/databases -y 'sqlite://storage.sqlite' -Y 'mysql://userxx:password@localhost/web2py'

creating tables...
EXCEPTION: could not make a copy of the database
'NoneType' object is not iterable
[ dave@andromeda(0.27,) 4:45:49am ] /home/www-data/web2py
$

Thanks
David

mart

unread,
Jul 19, 2013, 5:24:02 AM7/19/13
to web...@googlegroups.com
Hi Dave, 

try it again without the quotes around the -y and -Y option values (an error in the book)

I.e.:    sudo python scripts/cpdb.py -f applications/Wikispots/databases -y sqlite://storage.sqlite -Y mysql://userxx:password@localhost/web2py


I hope it helps ! :) 

If not, let me know and I can debug from here.

regards,
Mart 

Dave Carlson

unread,
Aug 1, 2013, 11:37:45 PM8/1/13
to web...@googlegroups.com
Hi Mart

I did it without the quotes around the -y and -Y and when the quotes are completely removed, the command line arguments do not get passed completely and incorrectly parse. So I tried it with quotes around -Y and it parses the commands. Still doesn't work. 

It looks like the DAL creates some field with a value of NoType in SQLite and the conversion script and code get hung up on this. 

I will review the SQLite strucuture and see where the NoType is and attempt to change it to something workable.

Thanks for your help
Dave

Jim Gregory

unread,
Aug 3, 2013, 5:02:42 AM8/3/13
to web...@googlegroups.com
Are you using any special characters in the password for the MySQL database? I've found that can often cause problems when calling a MySQL database from the command line.
Reply all
Reply to author
Forward
0 new messages