On Saturday, January 5, 2019 at 7:15:02 AM UTC-8, Chris V. wrote: > > I never tryed fake migrate before but every time that I move an app to > another server first I put the app in the server then I delete everything > inside the database folder, then run the app via web browser (this create > the structure of the database)? then resotre the db backup and done app + > database working in the new server. I always do this with mysql but should > be the same for pg. > If you create the database first and the run the web2py will say that all > ready exist. > > > Cheers. > > Yes, fake_migrate exists to handle the second situation. Evidently, the auth tables are special-cased though.
El vie., 4 ene. 2019 9:37 p. m., icodk <i...@alpiron.com <javascript:>> > escribió: > >> First both fake_migrate and fake_migrate_all are part of the DAL >> signature in the book, However fake_migrate is only explained when it is >> used in a table definition, not in DAL. >> >> >> Second issue that might be related: >> I try to move web2py application to another server, including a pg >> database in the following order: >> 1. took a backup of the database on the old server >> 2. restored the database on the new server >> 3. Copy the web2py application to the new server include the databases >> files >> 4. my first attempt to run the app resulted in error: relation >> "auth_user" already exists >> 6. I verified that a file >> 63e111e1d2096351b383c8ebce6b217f_auth_user.table EXIST so why the error? >> 7. Deleted the auth_user table from the database and file >> 63e111e1d2096351b383c8ebce6b217f_auth_user.table >> 8. a new table was created and a new auth_user.table file but with >> another hex prefix: c8b669d15150d7109e5f7ab36744a5b7_auth_user.table >> 9. But now I got the same error on auth_group. >> 10.I solved it by just changing all the files with the old hex prefix to >> the new prefix and everything was working. >> There are only hex prefix to the auth tables because I Can't/didn't set >> the migrate table settings >> >> I also attempted to use the fake_migrate_all=True ,migrate=False but none >> of the auth files was created. Only my own tables files >> 1. deleted all the databases folder files and set DAL's >> fake_migrate_all=True ,migrate=False >> 2. Only my tables files (in databases folder), and scheduler files (with >> the new hex prefix) was created. >> >> Why not all tables files was created on fake migration? >> Why the auth tables migration file names need a hex prefix and why it >> is different for each web2py installation ? >> > It's an instance number, essentially. > If the hex prefix can be changed and everything is working ? why need it >> in the first place ? >> Shouldn't a complete copy of application and database just work out of >> the box ? >> > "Out of the box" is for creating a fresh application with an empty database. Chris V tells you how that can be used to "prepare the field" (vague farm analogy) for a copied app. The "fake_migrate" controls are in the box, but under a warning label. > >> (2.17.1-stable+timestamp.2018.08.05.17.57.00 >> (Running on nginx/1.12.1, Python 2.7.14) >> >> >> /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. For more options, visit https://groups.google.com/d/optout.