

Development / Staging / Production Best Practices - user90

We are a small team of web developers with currently one shared LAMP Development server. Currently we develop on the Development server and then deploy straight to our Production server. We are deploying a second server which will act as our Staging server.<p>I am interested in hearing from the HN community on best practices for Development / Staging / Production servers. I would like to automate transferring files/database from Development to staging to Production much as possible as we are a small team.<p>What practices do you use to maintain your web development servers? We don't currently use any source code version control software so I would especially be interested in hearing how subversion git/etc can help. Thank you.
======
jamesbritt
"We don't currently use any source code version control software so I would
especially be interested in hearing how subversion git/etc can help."

Wow.

The funny thing is, I hear this quite a lot from self-described "Web
developers". I don't quite get how anyone can do any sort of development for
very long without using a version control tool, but it seems quite common
among the "Designers who know just enough PHP" crowd.

My deployment process revolves around using git (and before that it was
mercurial, and before that, svn). Rather than get into any details on it, you
should first get acquainted with git and/or mercurial, learn why these kinds
of tools are essential, and then get an understanding of deployment
strategies.

These might be helpful:

[http://people.canonical.com/~ianc/papers/dvcs-why-and-
how.xh...](http://people.canonical.com/~ianc/papers/dvcs-why-and-how.xhtml)

[http://stackoverflow.com/questions/2704996/describe-your-
wor...](http://stackoverflow.com/questions/2704996/describe-your-workflow-of-
using-version-control-vcs-or-dvcs)

[http://pythonnewbie.wordpress.com/2009/12/23/distributed-
ver...](http://pythonnewbie.wordpress.com/2009/12/23/distributed-version-
control-is-the-future/)

~~~
user90
Yes, we are aware that adopting version control is well overdue. Thanks for
the links!

------
Travis
I break more of these rules than I obey.

1\. version control. get it. force it to be used. I use SVN but I'd recommend
using git or mercurial. Doesn't matter as long as it's a newer one (CVS,
yech). 2\. automate. automate everything. You should be able to run a commit,
then click a button to update your new staging server. One click deploy to
production. ALSO - make sure you can one click UNdeploy. I'd suggest writing
shell scripts that will automatically check out the correct revision, move
pointers around, change permissions, etc. 3\. Make all your environments as
similar as possible (same versions of code, etc.)

Other than that, I can't think of much. You don't need to use capistrano to
manage your deployments -- just use some simple shell scripts with rsync!

I'd recommend that your production and dev servers (hardware or VPS) be
different. That way if you screw something up while developing, it wont put a
load on your production system.

~~~
user90
Thanks for the reply. Can you further expand on the one-click deploy to
staging/production? Which tools/methods/scripts do you use?

