Hi I’ve been using a combination of guides to deploy mainly this one.
I need to prepopulate my database.
question 1: How do I do this?
Can I just use seed and do this.
Where I set the environment variable in my server like so?
MIX_ENV=prod mix run priv/repo/seeds.exs
The problem is I’m not entirely sure where is the seeds file path is on my server. I got a
releases folder and
Question 2: Every time I deploy, does it nuke and erase all data from the production?
If the answer is yes how do people work around this in term of work flow? Backing up the existing production data? Deploy, run the backup production data? It seems tedious.
My current solution is I’ve been ETL web scraped data into an SQL script for each table. I just scp the script onto production server. From the server I run the sql insert script on to the production database.
It’s pretty tedious and am looking for alternatives.
Thank you for your time.