Massimo, I started again this morning as I will ultimately need to solve
this, but am still having issues. As I enhance the FEMA application I will
need to move between the production environment and the dev environment
without loosing data. This has worked flawlessly for me in the past, but I
must be doing something wrong now.
Production environment = Webfaction, Apache, Postgress, web2py 1.99.4
Development machine = Windows, Rocket, sqlite, web2py 2.0.0
Here is what I did:
1. On production I packaged and downloaded the working application
2. I installed via the admin interface on my dev machine
3. I added the migrate_enabled to the DAL ( db =
DAL('sqlite://storage.sqlite', migrate_enabled=True) )
4. When i run I get the error below and web2py hangs
Error:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Traceback (most recent call last):
File "gluon/restricted.py", line 205, in restricted
File "C:/Users/david/My
Projects/Miscelaneous/web2py/applications/COPSIS/models/db.py"
<http://127.0.0.1:8000/admin/default/edit/COPSIS/models/db.py>, line 47, in
<module>
File "gluon/tools.py", line 1397, in define_tables
File "gluon/dal.py", line 6694, in define_table
File "gluon/dal.py", line 785, in create_table
File "gluon/dal.py", line 1465, in create_sequence_and_triggers
File "gluon/dal.py", line 1477, in execute
File "gluon/dal.py", line 1471, in log_execute
OperationalError: table auth_user already exists
I then tried to delete everything in the databases directory and reran the
app. I was unable to delete the log file. a new sqllite database was
created, but no table files and web2py hung again.
I killed web2py. was successful at deleting everything in the web2py and
the application worked.
I then tried copying the sqlite dataase file from production to preserve
some of the original data and am back to having "Operational Error: no such
column" invite. message"
AM I doing something wrong or has something changed in the past 2-3 months?
On Friday, June 1, 2012 11:31:17 PM UTC-4, Massimo Di Pierro wrote:
>
> Hello David,
>
> Do you have a backup of the databases/ folder that worked with a previous
> version?
>
> If so..., delete everything in databases. Than do:
>
> db = DAL('sqlite://storage.sqlite', migrate_enabled=True)
>
> Do you get an error? If you do not get any error, check which table files
> different from the backup and newly created ones. Which version are you
> upgrading from?
>
>
> massimo
>
>
>
>
> On Friday, 1 June 2012 20:20:03 UTC-5, david.waldrop wrote:
>>
>> I just downloaded the nightly build form Trunk to test the new web2py 2.0
>> with some of my web2py based solutions. I now have a very weird eroor I
>> think due to migrating the database form postgress (production) to sqllite
>> (development). Here is one of the errors I get:
>>
>> Traceback (most recent call last):
>>
>>
>
>> File "gluon/restricted.py", line 205, in restricted
>> File "C:/Users/david/My
>> Projects/Miscelaneous/web2py/applications/COPSIS/controllers/items.py"
>> <http://127.0.0.1:8000/admin/default/edit/COPSIS/controllers/items.py>, line
>> 776, in <module>
>> File "gluon/globals.py", line 175, in <lambda>
>> File "gluon/tools.py", line 2679, in f
>> File "C:/Users/david/My
>> Projects/Miscelaneous/web2py/applications/COPSIS/controllers/items.py"
>> <http://127.0.0.1:8000/admin/default/edit/COPSIS/controllers/items.py>, line
>> 20, in additem
>> File "gluon/sqlhtml.py", line 1298, in accepts
>> File "gluon/dal.py", line 7255, in insert
>> File "gluon/dal.py", line 1009, in insert
>> OperationalError: table item has no column named name
>>
>>
>> I have tried several of the migration options, but none seem to work thus
>> far.
>>
>> Here is the code in db.py I tried after searching the google group:
>>
>> db = DAL('sqlite://storage.sqlite', migrate_enabled=True,
>> fake_migrate_all=True)
>>
>>
>> When I look in the application/database subdirectory there are not .table
>> files for each table, which does not seem correct.
>>
>>
>> Any Ideas or suggestions would be greatly appreciated.
>>
>>
>>
>>
>>
>>
On Friday, June 1, 2012 11:31:17 PM UTC-4, Massimo Di Pierro wrote:
>
> Hello David,
>
> Do you have a backup of the databases/ folder that worked with a previous
> version?
>
> If so..., delete everything in databases. Than do:
>
> db = DAL('sqlite://storage.sqlite', migrate_enabled=True)
>
> Do you get an error? If you do not get any error, check which table files
> different from the backup and newly created ones. Which version are you
> upgrading from?
>
>
> massimo
>
>
>
>
> On Friday, 1 June 2012 20:20:03 UTC-5, david.waldrop wrote:
>>
>> I just downloaded the nightly build form Trunk to test the new web2py 2.0
>> with some of my web2py based solutions. I now have a very weird eroor I
>> think due to migrating the database form postgress (production) to sqllite
>> (development). Here is one of the errors I get:
>>
>> Traceback (most recent call last):
>>
>>
>
>> File "gluon/restricted.py", line 205, in restricted
>> File "C:/Users/david/My
>> Projects/Miscelaneous/web2py/applications/COPSIS/controllers/items.py"
>> <http://127.0.0.1:8000/admin/default/edit/COPSIS/controllers/items.py>, line
>> 776, in <module>
>> File "gluon/globals.py", line 175, in <lambda>
>> File "gluon/tools.py", line 2679, in f
>> File "C:/Users/david/My
>> Projects/Miscelaneous/web2py/applications/COPSIS/controllers/items.py"
>> <http://127.0.0.1:8000/admin/default/edit/COPSIS/controllers/items.py>, line
>> 20, in additem
>> File "gluon/sqlhtml.py", line 1298, in accepts
>> File "gluon/dal.py", line 7255, in insert
>> File "gluon/dal.py", line 1009, in insert
>> OperationalError: table item has no column named name
>>
>>
>> I have tried several of the migration options, but none seem to work thus
>> far.
>>
>> Here is the code in db.py I tried after searching the google group:
>>
>> db = DAL('sqlite://storage.sqlite', migrate_enabled=True,
>> fake_migrate_all=True)
>>
>>
>> When I look in the application/database subdirectory there are not .table
>> files for each table, which does not seem correct.
>>
>>
>> Any Ideas or suggestions would be greatly appreciated.
>>
>>
>>
>>
>>
>>