Reputation: 27861
I was watching this talk from DjangoCon 2011: http://ontwik.com/python/pycon-2011-deploying-django-web-applications-to-the-cloud/ and Cosmin Stejerean (presenter) mentioned that it is not a good idea to do syncdb on production database. So then what is a good way to deploy a production database?
Thanx
Upvotes: 0
Views: 321
Reputation: 239290
It's hard to know what he meant with that statement without context. The videos will probably be interesting to watch later, but I don't have time to sit through 3 hours of a talk at the moment. (Perhaps if you gave the timecode for when the statement occurs, it would be easier for people to explain it to you.)
Regardless, at some point you have to run syncdb on your production database. I would imagine he's talking about running syncdb again after the initial run and after your site goes live, as his statement would be even more cryptic at that point, but even then, you pretty much have to do that if you're adding new models. You can't really replace your production database as it has live data on it that could change any second (ruling out doing something like making a copy, running syncdb on that, and then restoring the production database from that -- you would inevitably lose data in that approach).
So, again, perhaps with context, it might make more sense, but prima facie, not only is it not a bad idea, but it's really the only acceptable course.
Upvotes: 2