Will deploy.sh update the database on the remote environment?

I haven’t used Trellis for a while. I got the local development environment up and running and the WP site shows up and stuff. Then I got the remote staging provisioning and deploy working so it provisioned the server and deployed the repo.

When I went to the URL though, it took me to the WordPress install form. I just completed the form and now the site appears to be running like it should.

Is this because I never actually did anything to the local dev site before deploying? Or is there some other step I’m going to need to follow to get it to push the database changes to the staging environment?

I’m seeing a few other posts about this, and most of them are talking about using wp-cli and something like db-migrate. Is this something I’m supposed to run after deploy.sh in order to migrate the database to the staging environment, or is this integrated into the deploy process and I just have it setup wrong?

I followed the instructions from this page: https://roots.io/trellis/docs/deploys/

Based on what it says, I would have assumed the development site would be deployed as-is to the staging environment. The next step from that page is FastCGI Caching. I don’t see anything on the right menu there about wp-cli or database migration.

I’m probably missing something obvious. What’s the correct process for syncing the local development environment database to the staging environment after running deploy.sh?

Would something like this be what I’m looking for?

Or ideally, is there an integrated method for doing the deploy and the database/uploads migration all in one step with deploy.sh?

The docs you linked say:

Trellis does not automatically install WordPress on remote servers. It’s normal and expected to see the WordPress install screen the first time you deploy. It’s up to you to either import an existing database or install a fresh site.

There’s lots of topics on this forum about migrating DBs as you saw. Up to you to pick a method that suits your needs.

Is there any particular method you’d recommend?

Or, does anyone else have any thoughts as to what would generally be the “best” method? (I know circumstances vary and certain methods might be better for some than others)

Well he unlisted this so most people probably can’t see it but I wondered that if Trellis is this awesome in terms of deployment why should it ignore DB movement. Anyhow, I am also interested in this but won’t have time as I’m on a very time sensitive project atm. If you do more research/trials, I’d love to hear what you think is pro/con or current methods.

https://roots.io/leveraging-wp-cli-aliases-in-your-wordpress-development-workflow/

https://discourse.roots.io/t/leveraging-wp-cli-aliases-in-your-wordpress-development-workflow/8414

1 Like

Awesome, thanks for that!