Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Modern WordPress Workflow The Production Server Situational Deployment Exercises

How would I push from a staging server to the live server.

I've been following along, set up a serverpilot accound and digital ocean droplet to test out the workflow and I'm missing the steps to push from a staging server to the live server.

5 Answers

Jesse Petersen
STAFF
Jesse Petersen
Treehouse Guest Teacher

They should be the same setup, so two something like 2 droplets or 2 linodes (they're so cheap) or if you have a host with multiple installs available, that's fine. Yes, I use a subdomain and limit to my IP address so it doesn't get crawled.

There are some nice flowcharts with some good Googling but since there are so many ways to skin this cat, there are a lot of different flowcharts.

Thank for the answers, helps out lots but I have a new question. Staging and Production servers. You want these to be on the same server or company? Am I going to have some random website name like mystagingsite.com or maybe put it on a subdomain? Any chance of having a flow chart of all this laying around? Great stuff Jesse!

Kevin Korte
Kevin Korte
28,148 Points

How are you tracking the code? Are you using git? Can you push your git repo to your server? I'm not familiar with your exact set up of servers, but usually what I do is push my production code to the staging server first, test everything that needs to be tested, and if it passes the final sniff test on the staging server, I push the production ready code to the live server. But I don't usually push from staging to live, rather I push from the same repo.

You of course want your staging server and your live server to be identical environments to ensure the smoothest update. Does that help?

Jesse Petersen
Jesse Petersen
Treehouse Guest Teacher

In the course, we do not deploy from Git. We use Git for version control, but deploy from local.

Jesse Petersen
STAFF
Jesse Petersen
Treehouse Guest Teacher

If you are using WordMove, you add a new environment (one is started for you) in the Movefile. You then use the environment tag when you push from local to live. I want to say it's -e=live (or whatever you name that environment in the file). To be safe, once I have more than one environment, I always use the -e tag.

Leigh Maher
Leigh Maher
21,830 Points

I've found this tool: http://ftploy.com which automatically uploads any commits you do locally to the staging (or live) server. It's a great workflow. It doesn't require SSH, which is great, as my host doesn't offer it. Only down side is that you can only have one site set up for free. It's £6 (sterling) a month for up to 10 sites.

Also, for migrating the database, this is an excellent plugin: https://github.com/wp-sync-db/wp-sync-db