Amesey
Amesey

Reputation: 852

Push content from staging to live in WordPress

What is the best and easiest way to push content from a staging site to a live WordPress site?

I've explored various plugins like Site Push and Push Syndicate but am baffled by what I need to do.

The whole point of this is to add new or update existing content for approval before pushing to the live website.

Can anyone suggest a user friendly plugin or explain in a very simple way on how to do this?

Upvotes: 0

Views: 1077

Answers (1)

ServerStorm
ServerStorm

Reputation: 99

Probably a better way would be to have version control as a middle-man. So you would have a github or a bitbucket account that would have dev, qa, staging and master branches on it. You may not use qa and go dev, staging.

You then have a local repo that is synchronized with the cloud repository. You could merger dev into staging ( or qa ) when ready, test, and when it is ready to move to production merge with your master branch.

At this point you have two options. If using github you could use their service hooks to send a $_POST of your changes to your server. On your server you'd have a php script that would read the post and then update the server's git repository. Your code would automatically be pushed to prodcution when merged into master and pushed to github.

Alternatively, you could have a git repo within the production servers root folder and manually pull the master branch. You would ssh into your server and via the command line use the simple command:

git pull origin master

You would previously have to had to setup the origin alias by issuing this command in the server repo:

git remote add origin

This would manually pull the master code from github / bitbucket to your production server.

You may be able to do the 'hooks' method with bitbucket, I've personally never looked into this.

In summary, using github as a middle-man allows you to simply update your server and roll it back if needed. Doing any other copy method will not easily allow rollbacks.

Regards, Steve

Upvotes: 0

Related Questions