#1 is version control. Without that you are lost. SVN, git, CVS, whatever as long as it's working for you.
#2 is simplicity. Without it, your systems will simplify themselves in a sub-optimal manner (i.e. dev server becomes production server).
Here's what I do:
- Developers work and test on their local machines and commit using version control to a central repository
- Dev site is a sub-folder of the production site - easy way to make sure every single damn variable is the same
- When I want to upload to dev environment:
rm -r dev (to remove all files in current dev site)
svn export file://(path) (to get a complete copy of latest code)
- When I want to upload to production environment:
source upload.sh, where upload.sh copies the existing site into a backup directory for quick access in case of disaster, then copies the dev site up into production, then re-copies a couple special files that differ between dev and production back (.htaccess, analytics.php)
Good luck!