.env file on the production server

I think this is a two part question. First - i have deployed with Capistrano into a shared server.

All the files are (finally) getting to the revisions/TIMESTAMP directory, but there’s not an .env file in it, so we can’t connect to the DB.

I can move one there, but I think there’s some setting I’m not doing correctly.

Secondly - once it’s created, do I have to manually populated it with a dump from the development db?

Capistrano doesn’t do anything to create a .env file so you have to do that manually yourself to begin with. And yes you’d need to copy over the database if you want. Capistrano just does a git clone so obviously nothing to do with the DB is included in that.

Does the .env file need to be moved or created each time a deploy is done? In the old tutorial I followed we were instructed to put the .env file in deploy/shared, but I don’t see any reference to that directory in the bedrock-example repo.

It will automatically symlink it on each release.

1 Like

Of course! I did watch the video. Thanks, Scott. It’s starting to make sense.