I got to install the update of an already existing extension (in the community code) in my project. So, I got the files gathered in a zip file. I've got files for the code, for the shell, js, skin. Anyway, there are a lot of files, and I was wondering (since it is gonna be my first time to update an extension) whether I should just replace all the files, that already exist, with the files that I've been given, by copy-paste, or there is a simpler way?
I think the only way is to copy and paste the files into the root folder. The best way to do something like this is to create a test environment with a copy of the code and the database. Even better is to do that in a VM. Create snapshots along the way for each major step until you get it working. Mark the snapshots with meaningful names. Then for the working test environment, update the extension and see if it works. You can now mess with everything without consequences. If something goes wrong, revert to a previous snapshot and start over.
Many times I've experienced problems with extensions. Now you can test, search for a fix if it doesn't work, without risking your production environment. If something goes wrong it can get difficult to get it working again.
When you apply the update to the production environment, make a list of what should be tested when the update is live. Then make a copy of the code on the same server, with all rights preserved (Linux:
cp -rp htdocs htdocs-backup for instance). Then make a backup of the database, apply the update, and test.
The extensions should always be packaged in a standard way and be installed in a standard way. There are 2 options to install an extension correctly:
- via Magento Connect GUI
- via command line tool ./mage
Both methods ensure proper installation and registration of extension by Magento. There are some special XML files under var folder that should not be removed. Extensions that are installed properly can be versioned, upgraded and uninstalled. This helps to retain control over your Magento solution.
Never install anything directly to production. As an absolute minimum use 2-tier environment: development and production. In a good setup there are four tiers:
- development (one or more developer machines)
- testing (dev company internal test)
- staging (customer test or pre-live)
It is all glued together by GIT version control and good deployment processes. A working CI server is a plus.
Lot of Magento extension developers distribute their free or premium extensions via their own webstores as ZIP archives. ZIP archives are a non-standard. Extensions should be packaged with Magento extension packager and the result is a properly packaged .tgz file that can be distributed to users.