NopCommerce Upgrade Strategy
We are using NopCommerce, an open-source, third-party eCommerce system, over which we have developed custom solutions for our products. The NopCommerce community continuously works on improving the platform, which includes bug fixes, security patches, performance enhancements, and adding new features. These improvements often lead to new releases, which sometimes are major upgrades.
Upgrading NopCommerce is an essential process to maintain security, performance, and access to new features. However, it requires careful planning and execution, especially when custom code is involved. By following a systematic approach and testing extensively, we can ensure that upgrades are successful without disrupting live operations.
Our customizations to NopCommerce include:
- Image generators for our products
- Custom theme/design
- Core system modifications in certain places
Since modifying the core system makes future upgrades more complicated (as customizations can be overwritten), we keep track of the customizations and re-apply them after every upgrade.
The Upgrade Process
When requested to add new features, the quickest approach would be to continue with the same version. However, this would make future upgrades more difficult. The latest version of NopCommerce often has built-in features that are required, so it’s best to upgrade the system first. This way, we ensure that we are working with the most recent version and avoid future upgrade headaches.
The general upgrade process includes the following:
1. Upgrade the Core System
- This involves upgrading the application and the core code.
- During this upgrade, the custom code will be overwritten, so it will need to be reapplied later.
- The core system upgrade should be done first to benefit from the latest bug fixes, security patches, and performance improvements.
2. Database Upgrade
- The database structure will need to be updated without losing any existing data.
- Ensure the database schema is updated to match the new version’s requirements.
3. Theme/Design Upgrade
- The theme and design must be updated according to the latest version’s requirements.
- This ensures the visual aspects of the store align with the new version of NopCommerce.
4. Upgrade Strategy for Multiple Releases
- If there are several new releases in a row, upgrades need to happen sequentially. We cannot skip versions.
- The upgrade from version 2.xx to 3.xx is a major release and is considered the riskiest. After this, subsequent releases are less risky.
Steps for Upgrading NopCommerce on the Live Server
When upgrading the application on the live server, I follow this sequence of tasks:
-
Back Up the Application and Database:
- Download the entire application and database as a backup.
- Either create a backup on the server or request hosting support to handle it.
-
Test Locally First:
- Perform the upgrades (application, database, and theme) sequentially on a local machine.
- Test thoroughly on the local machine to ensure everything works correctly before making changes to the live environment.
-
Apply Upgrades to the Live Environment:
- Run the same set of upgrades on the live server.
- If the upgrade fails, upload the locally upgraded system to the live server.
- If the local system fails as well, revert using the backups created in step 1.
-
Monitor and Test Post-Upgrade:
- Once the system is online, monitor it closely for about a month to fix any bugs or issues that arise with the latest version.
Time Constraints
All of the above tasks need to be completed within approximately 1 hour to avoid downtime and customer loss. The upgrade must be thoroughly tested during the process, especially in the local environment, to ensure the system functions as expected before going live.