I've got my AWS linux system ticking along nicely with my heavy table under 
PostGres [1], but I still have uploads, Auth, and Scheduler under sqlite.  
I'd like to move them to PostGres, so I'm double checking that I'm using 
the appropriate steps to get there:

1. Create uploads table by copying the define_table() call from db (the 
database from the sqlite URI) to dby (the database from the PostGres URI)
e.g,
db.define_table('uploadf', ...)
gets copied to
dby.define_table('uploadf', ...)

For the table I already used, there was an issue with migration giving the 
correct resulting table files  until I changed the table name from "tname" 
to "tname_y" (the error message has been scarred over).  I hadn't seen this 
when making a backup sqlite database (called 'dbx'), I didn't need to name 
the backup "tname_x".  [2]
Should I expect to need this dodge in moving uploads?

2.  Do the usual export as CSV from the old table.

3.  Import the CSV in the new table.

(That's essentially the steps I used for the heavy table)

Auth and Scheduler have the define_tables() on the inside, so all I need to 
do is?

1.  Change the instantiation from
auth = Auth(db)
scheduler = Scheduler(db, migrate=False)
to
auth = Auth(dby)
scheduler = Scheduler(dby, migrate=True)
(and then migrate=False soon after)

2 and 3 as for uploads?

[1] Aside from my issues with switching from pg8000 to psycopg2.
[2]  Before bringing in PostGres, I tried adding a table to db for saving 
some test results longer term than uwsgi lets me keep log messages.  The 
"table already exists" errors kept piling up even after I turned off 
migrates, until I noticed the new table didn't have a UUID in its name.  I 
"fixed" this by copying the UUID from another table name and renaming the 
new .table file.  But I have another .table file with no UUID that works 
fine.  This is 2.15.4, though, so could be something fixed since then.

Thanks for the help.

/dps


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/529ac2f2-9f4f-4db3-85ea-9d2d27bc180a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to