I had a nice reminder recently of why itâ€™s good to stick to best practices when putting something shiny and new out for others to see.Â Something that was supposed to be easy ended up causing some furrowed brows for a bit.Â Luckily, it ended up being just a bump in the road thanks to some spot-on work by my creative counterpart, and some good, old-fashioned use of vi (still the handiest tool to have around, in my book).
So basically we learned a lot about the surprisingly crazy things that WordPress will do when moved without due care.Â Like modify your themeâ€™s source code.Â And also, it was a good reminder to follow best practices when deploying an application, even when it looks like a slam dunk.
I know many of you already practice this, and itâ€™s a bit of preaching to the choir, but hey, everyone in IT loves to talk about how things should be done, so letâ€™s sing it together:
- Have development, test, and production environments that are separate but identical
- Keep developers out of test and especially production environments
- Use the same tools and procedures for moving updates from test to development as from development to test
- Have someone who wasnâ€™t involved in the development do the testing
- Have someone who was involved in the development on hand in case something goes wrong
- Have a good text editor handy
- Know more than you need to, just in case
- You do have a backup of production prior to making the change, right?Â Right?
Now, it is often the case that you or your client may not have the resources for development, test, and production environments.Â But having separate environments saves you so many headaches, that I advise you to grab an old desktop system and run free virtualization software (such as VMware Server or Sun VirtualBox).Â If youâ€™ve never had a formal process for doing this, it will seem like a waste of time at first, but trust me, it will save you plenty of heartburn down the road.Â Besides, a line about â€œvirtualizationâ€ looks great on the resume!
Once you have separate environments, and have an app that is looking good, you can deploy it to your test environment.Â Try to keep the test environment as restricted as possible, since you want any changes that need to be made done in the development environment.Â If possible, have someone not involved in creating or configuring the app test it.Â A coworker, an end user, or, if youâ€™re lucky, one of those jaded QA types.Â Notice that youâ€™ll not only be testing your application, youâ€™ll also be testing how you will be deploying the application to production.
In my experience, it’s best if the developers do not have access into your testing environment.Â Expect lot of complaining about this one, but you do not want developers saying, “oh, that’s not a big deal, I’ll just fix it in test,” and ruining the point of having separate development and testing environments (and usually the code repository, as well).Â I can’t count the number of times I have seen this cause problems.
After everythingâ€™s passed testing with flying colors (send it back to dev if it doesnâ€™t), youâ€™re ready to push your app out into production.Â Since youâ€™ve already done the process once successfully, it should be a breeze the second (or thirteenth) time through.Â Pat yourself on the back and head out early to the local brewpub (after making sure that everything is working fine, of course!).
And we all know that there are times when it certainly doesnâ€™t work fine.Â Which in a sense is why weâ€™re all paid the big bucks, right?Â When things do go wrong, itâ€™s best to have good resources on hand, whether itâ€™s debugging tools or debuggers.Â Far too many times, Iâ€™ve seen the people who developed an application,Â configuration, or whatnot, walk out the door on their way to vacation about 10 minutes prior to go-live.Â In many situations, simply having another knowledgeable person around will help immensely.Â If youâ€™re doing something specialized, like anything spelled â€œOracle,â€ keep your DBAâ€™s phone number handy and verify that someone is paying the licensing bills (a former employer did this to themselves six months after I left â€“ they tried to save money by not paying for software and ended up being down for two solid weeks â€“ genius!).
As for tools, it always pays to have a good text editor, that youâ€™re familiar with, handy.Â Vi, which I mentioned before, is extremely useful.Â Since itâ€™s available on basically every Unix and Linux system, itâ€™s a good idea to have a basic knowledge.Â On OS X, Iâ€™ve been very happy with TextMate, which recognizes a large number of text file formats (eg, HTML, Perl, PHP, etc.).Â Even lowly, unloved Notepad is an effective and useful Post-It Note.Â Other tools that are especially helpful include tcpdump and lsof on Unix,Â SQLdeveloper or SQL*Plus when working with Oracle, and with Windows, keep the install CDs handy!
Then thereâ€™s you.Â I really encourage everyone to have a basic understanding of how different platforms work, as I have yet to see an IT shop that ran completely on a single platform.Â Almost everybody has some mix of Windows and Unix servers, Cisco or low-end networking hardware, a database or three, some sort of storage, and probably the phones, too.Â If you know the basics of how most of those things work â€“ and especially, how they talk to one another â€“ your life is going to be a lot easier.Â And again, looks great on the resume.
Finally, make sure you have a good backup before you do anything.Â This goes double for big, important databases that C-level execs notice when it goes down.