By now, even if you're new to Magento, you should have a newfound appreciation for the power and extensibility of the industry's most active open source e-commerce platform. We've covered just about everything from installation to extending the platform. Your Magento store, if not already online, is most likely ready from a preparation viewpoint.
However, we're not quite finished yet. You may want to undertake a few more options that can make your installation act more like that of a Fortune 500 company — and less like a hobbyist's experiment in e-commerce.
In this chapter, I will take you through four advanced techniques that I feel any bona fide Magento master should have in their own personal knowledge base:
You may not wish to undertake all of these now, or later, but at some point you will find these concepts helpful in turning Magento Community into an enterprise-level contender.
I know it is so very tempting to install Magento onto a production server account, do the initial configurations, and launch your new store. I also know that if you're only working with one Magento installation, there will undoubtedly come a time when — no matter how careful you are — a buggy extension, an errant piece of code, or a mistyped tag will cause your site to "go dark." You may even experience the dreaded Magento error screen (well known for offering little advice or remedy).
Therefore, if you take no other advice in this book to heart, take this one seriously: create a staging environment.
Some developers, particularly those working for large enterprise operations, may want to create an elaborate remote development, staging, and production setup with matching hardware for each environment, to decrease the number of variables present when deploying and testing code. If you're working with a large team and you have the funds available for the time and effort needed to create this type of setup, by all means do so. It's more likely, though, that if you do fall into this category, you're better suited for Magento's Enterprise solution, rather than the do-it-yourself Community edition discussed in this book.
For those of us on smaller budgets — who appreciate what Magento Community offers as a robust yet open source platform — I would suggest that you use a simpler, more rapidly deployable solution. Keep it simple and manageable.
There are actually two staging setups I maintain: one for testing and one for client development. The former is used to test new extensions, programming ideas, and design concepts, with no particular client use in mind. The latter is created for each client site and, except for the data, is an exact duplicate of the client site in terms of code, extensions, and design.
For client sites, this is my suggestion for a basic operation procedure:
At some point, you will feel you're ready to "go live." Guess what? You probably are. If your staging and production installations are in sync, going live is merely repointing the live domain name to your production account and setting payment gateways to "live" mode.
One of the dubious benefits of writing a book like this one is that I get the pleasure of reliving some of my less brilliant moments as a student of Magento as I impart the wisdoms gained to you. This is one of those cases.
If you've followed the simple approach previously outlined, you should have a staging and a production environment that both work successfully. After all, you're not going to do anything to the production installation that you haven't already tried and tested on the staging installation. At least, that's the plan.
But once you launch the production store, there will come a time when you want to take a shortcut. Your client might be pressing to install a new extension they found at the Magento Connect website, or you might need to import some new product types the current store has not been using. Regardless, if you skip applying your changes to your staging installation and go directly to the production installation, you'll find that you will experience the moment when your heart drops out of your chest as your production store ceases to work as intended. It's another of Murphy's laws.
I only had to do that once — and suffer the client's anguished pleas to "get my store back online!" — to learn my lesson: staging first, then production. Never waiver from this dictum and you'll continue to successfully please your client, yourself, or whoever is the owner of the Magento store.