I am working on a Django app and have now reached the point of setting up my deployment process. I would like to automate this as much as possible and as such am looking for any help I can get in terms of database management. As I see it, this is the rough outline of the process I would like to automate: 1. back up the current database on the live server 2. merge the structure of the dev and deploy databases so as to keep only the data in the deployment db but update the structure to match the dev db
I have considered simply applying all of the new migrations from dev to the live db however I fear that this will result in a series of errors due to default values and such.
Any insights into where I could look to get started would be greatly appreciated!
Here are the commands. You can use whatever your favorite automation language is.
For this, our typical process is to actually just apply the migrations. If you are at all worried about the migrations, you can do this on your dev server:
This way you can test whether any of your migrations will cause issues on the live server without actually affecting the live server itself. After you have confirmed, you can: