Live data from Hacker News

Version Controlling Wordpress

roybarber.com

1–10 of 21 posts

Version Controlling Wordpress

#1
A lot of friends of the web asked how i usually work with Git + WordPress, so i wrote this to show the structure and steps I take to setup WordPress locally, version control and then deploy to a live server with Git. Avoiding the need for ‘Cowboy Coding’ and a fully backed up version of your website.

Version Controlling Wordpress
roybarber.com

Re: Version Controlling Wordpress

#4
Nice tut on git. Although not very real-world practical in case of Wordpress.

First - wordpress core does version control itself and offers one-click update for core files that are updated frequently.

Second - wordpress website consists of ever updating database (that is hard to version control) + set of custom files (like custom plugins, themes, uploads, images, media, etc...).

It does not really make sense to version control wordpress-based website although it makes perfect sense to take care of backups, especially comprehensive off-site backups in case of hack-attack or crash.

For that I use backupbuddy plugin (not affiliated, just grateful customer). It allows you to automatically create unattended, complete, compressed backups for your whole website: core files + your files + database. All in one piece - without you lifting a finger. Plus it auto-uploads your regular backups to chozen destination like amazon S3 or another FTP server and allows you to keep, say, last 10 backups.

This allows you to accomplish two very important things (that git does not do):

1. You may restore complete website from scratch in minutes - including full database structures.

2. You may copy your website to different domain and it will automatically update all URL's from old to new URL - again - in minutes.

That's a perfect tool for the job.

Thanks for putting tutorial though - I love git and use it often for separate projects.

Re: Version Controlling Wordpress

#6
post #4

Nice tut on git. Although not very real-world practical in case of Wordpress. First - wordpress core does version control itself and offers one-click update for core files that are updated frequently. Second - wordpress website consists of ever updating database (that is hard to version control) + set of custom files (like custom plugins, themes, uploads, images, media, etc...). It does not really make sense to versi…

Thanks for the feedback, I too used to use backup buddy, but found this way the quickest for deploying different branches to different sit-ups, an example would be dev/staging/live.

I agree it could be overkill to version control the full Wordpress install, but I prefer to have instant roll back if a update goes wrong.

Can backup buddy now deploy a backup via ssh? For locked down servers

Re: Version Controlling Wordpress

#7
I'm kinda intrigued by the way different settings for different domain are handled. I'm using the following approach:

http://www.lukeschreur.com/posts/configure-wordpress-for-mul...

For deployment I simply do an export from SVN on my local machine and an rsync over SSH to the server (scripted).

Re: Version Controlling Wordpress

#8
post #7

I'm kinda intrigued by the way different settings for different domain are handled. I'm using the following approach: http://www.lukeschreur.com/posts/configure-wordpress-for-mul... For deployment I simply do an export from SVN on my local machine and an rsync over SSH to the server (scripted).

I've used the same approach before, you can also do it by setting the environment within apache. But this was the simplest for multiple developers who wold work on the same repo

Re: Version Controlling Wordpress

#9
post #4

Nice tut on git. Although not very real-world practical in case of Wordpress. First - wordpress core does version control itself and offers one-click update for core files that are updated frequently. Second - wordpress website consists of ever updating database (that is hard to version control) + set of custom files (like custom plugins, themes, uploads, images, media, etc...). It does not really make sense to versi…

I use a method very similar to the one in the tutorial to manage development on a site that I've been developing features on for the last six months. Basically the site is the MVP for a proudct that is being redeveloped in another system, but for the time being, they just want to push out features to see how well they work, and so... WordPress.

So I am sending out revisions to custom plugins and the theme daily, and for me there is a great advantage in that I can just push to my production environment and not have to do all the annoying things that I used to do as far as uploading files via FTP.

Generally, I have the uploads directory outside of the repo, and so if I need to sync up my local version to the site I will pull the uploads directory down and create another version of the database, and then update my local config file.

This is a very different use case than backing up the site (but obviously that needs to be possible as well). But git is very helpful in my case as well.

Re: Version Controlling Wordpress

#10
post #4

Nice tut on git. Although not very real-world practical in case of Wordpress. First - wordpress core does version control itself and offers one-click update for core files that are updated frequently. Second - wordpress website consists of ever updating database (that is hard to version control) + set of custom files (like custom plugins, themes, uploads, images, media, etc...). It does not really make sense to versi…

I use a method very similar to the one in the tutorial to manage development on a site that I've been developing features on for the last six months. Basically the site is the MVP for a proudct that is being redeveloped in another system, but for the time being, they just want to push out features to see how well they work, and so... WordPress. So I am sending out revisions to custom plugins and the theme daily, and…

As a note, wordpress core is also not part of my repo.
Post reply on HN