It's not quite clear exactly what you have copied and/or changed, so hard 
to say what you need to do. But in general, if you want to update your code 
and have the production database migrated to match the new code, you should 
copy everything *except* the contents of the /databases directory (leave 
the production /databases directory untouched). Then after the code has 
been copied, make sure migrations are enabled, and on the first request, 
the production database will be migrated to match the new models. Sounds 
like you didn't follow that process and things have gotten out of sync.

Anthony

On Monday, October 23, 2017 at 6:54:22 AM UTC-4, Yebach wrote:
>
> Hello
>
> So as said I copied the whole app directory to my new server, also 
> restored my database on postgres.  
> First my settings for migrate and false_migrate are set to False and 
> immediately I get an error: relation of table auth_user already exists. I 
> set the migrate for this table (auth.define_tables(username=False, 
> signature=False, *migrate = False*) ) to False, then I get an error 
> relation of table scheduler already exists. So i set migrate = False for 
> that table also in my scheduler.py file. And afterwards the app itself 
> works. 
>
> I already find this kind of behavior strange since I copied "stuff" and 
> things don't work --> I would appreciate guidance for further migrations 
> already here. I need to keep my auth_user table data etc.
>
> Now I want to use my new db.py file and if I set migrate to True - I get 
> an error immediately that table xyz already exists. 
>
> Any suggestions 
>
> 2017-10-18 16:48 GMT+02:00 Anthony:
>
>> On Wednesday, October 18, 2017 at 10:37:17 AM UTC-4, Yebach wrote:
>>>
>>> I am trying to keep my production db with all its data but update the 
>>> structure with the new web2py db code
>>>
>>
>> Yes, then as noted below, just update the web2py code, make sure 
>> migrations are on, and do *not* touch the production /databases folder 
>> (the *.table files there provide a record of the current state of the 
>> production database, so web2py knows what migrations to run to make the 
>> database match the new model code).
>>
>> Anthony
>>
>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/opmKbIW-7LA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Lep pozdrav 
>
> Vid Ogris
>
>
>

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