NCache, an in-memory distributed caching solution, known for its speed and linear scalability, is an ideal choice for your .NET, Java, Python, and Node.js applications. It allows you to cache frequently accessed data, reducing network and database trips while improving the overall performance. While NCache can work with any application stack, its significance is appreciated for time and mission-critical applications where performance and high availability are key requirements.
To maintain optimal performance, extended platform support, and overall stability, you must upgrade to the newest version. Not upgrading may result in potential compatibility issues, security vulnerabilities, and missing out on the latest feature enhancements. While NCache offers a Live Upgrade feature for its Enterprise Edition, upgrading NCache offline is also a smooth and hassle-free process with minimal interruption to your application.
The process involves backing up data, deactivating and uninstalling the old version, followed by installing, configuring, and activating the latest NCache version. This blog will guide you through each of these steps to seamlessly upgrade your NCache servers and clients offline, beginning with the servers and then clients to ensure a smooth transition.
1. Prerequisites for Upgrading NCache
There are a few important prerequisites to consider to upgrade NCache offline.
Create a Backup of config.ncconf
Before starting the upgrading process, it is recommended that you create a backup of your config.ncconf file as XML template (config.xml). This will allow you to restore your existing cache configurations post-upgrade. You can create the backup yourself or if you have any queries, you can contact the Alachisoft Support Team.
Deactivate Older NCache
Through the deactivation process, NCache allows you to transfer your licenses from one machine to another. It is important to know that license deactivation is not enabled by default, you need to get in touch with Alachisoft Sales to activate it. Once enabled, you can utilize the Unregister-NCache PowerShell cmdlet to deactivate the machines, as shown below.
1 |
Unregister-NCache [-Key] [-OfflineDeactivate] [-Server] [-Port] [-Credentials] [-NoLogo] |
The deactivation can be done through two methods:
- Online Deactivation Process: In this process, you run the above command with your license key on an internet-enabled machine, followed by a success message confirming deactivation.
- Offline Deactivation Process: In this process, for a machine without internet you run the same command with the OfflineDeactivate parameter, which gives you a Deactivation Request Code URL that is verified through an internet-enabled machine to complete the deactivation process.
2. Uninstalling the Current NCache Version
Once the prerequisites are all in place, you can proceed to uninstall the current NCache version using the steps below.
Stopping NCache Processes
Prior to uninstalling, ensure all NCache processes are stopped by using the following PowerShell command as any application using NCache during this process will trigger an error.
1 |
Stop-Cache [-Name] [-IsGracefulStop] [-Port] [-Server] [-IsStopForMaintenance] [-Timeout] [-Credentials] [-NoLogo] |
Uninstalling NCache
Once all cache processes are halted, you can now uninstall the current NCache version from both the server and client. In Linux, you can use the command ’sudo ./uninstall’ in the terminal. However, for Windows, you can use the Control Panel.
3. Installing NCache Version and Activating Licenses
You are now ready to install the new NCache version by following the steps below.
Installation Process
Download the latest NCache version. Next, follow the installation wizard to complete the installation for Windows. Whereas for Linux, run the below command from the directory where the NCache installation script is placed:
1 |
sudo ./install -f John -l Smith -e johnsmith@yourdomain.com -c your_company_name -k XXXXXXXXXXXXXXXXX -m server -s yes -i 20.200.20.38 -P password |
Activating New NCache Licenses
Once installed, you can proceed to Activate the NCache License. You can use the Register-NCache PowerShell cmdlet below to activate the machines by using the key provided to you upon purchasing the NCache license. Furthermore, if a new license version is required, it is recommended to contact the Alachisoft Sales Team.
1 |
Register-NCache [-Key] [-Environment] [-Clients] [-Address] [-City] [-Company] [-Country] [-Email] [-FirstName] [-LastName] [-Phone] [-Reactivate] [-State] [-ZipCode] [-AuthCode] [-Server] [-Port] [-Credentials] [-OfflineActivate] [-KeyType] [-RegisterAs] [-NoLogo] |
The activation can be done through two methods:
- Online Activation Process: For machines with internet, run the above command with your license key. Upon successful activation, a confirmation is displayed.
- Offline Activation Process: For machines without internet, run the same command with the OfflineActivate parameter. This gives you an Activation Request Code URL, that is verified through an internet-enabled machine to complete the activation process.
4. Reconfiguring Caches and Adding Client Nodes
After successfully installing and activating the new NCache version, you can proceed to configure and create your caches via the NCache Management Center, the Command Line, or to avoid discrepancies and ensure effective configuration utilize the backup template you created earlier in step 1. You can reconfigure the caches using the following command, which replicates the settings from the template:
1 |
New-Cache -Name demoCache -Server 20.200.20.39 –Path C:\config.xml |
Similarly, you can add client nodes to connect applications to cache servers by using the NCache Management Center or Command Line Tools. To ensure proper client-server mapping, you can follow the detailed steps from our Administrator’s Guide. Additionally, it is recommended to enable remote installation on your client-side to benefit from features like OutProc Client Cache, client monitoring, management, and licensing.
Upgrading NCache Clients
Now, to successfully migrate to a new version, you must also upgrade the NCache client nodes, whether through online or offline processes, the approach remains the same as outlined for the server-side. This includes deactivating, uninstalling the older version, installing the latest version, and activating the new licenses.
Recompiling Applications and Assembly Redirection
When the client-side nodes are installed and the new licenses are activated, it is essential to verify the application’s compatibility with the new version. Upgrading your application can be done in the following two ways:
- Recompiling Applications: In most cases, rebuilding applications with the latest NCache assemblies or NuGet Packages is sufficient to upgrade them without any code changes. However, there can be situations where minor code or configuration changes may be needed, as detailed here.
- Assembly Redirection: Assembly redirect can be used as an alternative if you are constrained by unalterable code requirements. It is recommended to consult the Alachisoft Support Team for detailed guidance on assembly redirects or a comprehensive understanding, refer to the Assembly Redirection section.
5. Post-upgrade Testing and Verification
Once your NCache version is upgraded, it is essential to assess the functionality of the server and client nodes. This includes verifying connectivity and performance of both, under normal and stress conditions.
Testing the Cache Cluster for Connectivity
To ensure successful installation, verify connectivity among the cache servers for effective communication and high performance. You can use the following PowerShell cmdlet to list all the nodes of the cache, their statuses, the connections between them, and connected clients to check the cluster’s health:
1 |
Get-ClusterHealth [-CacheName] [-Server] [-Continuous] [-SampleInterval] [-NoLogo] |
Verifying Client Operations
After ensuring cluster connectivity, another crucial thing to verify is the client-side operations. You can use the following PowerShell cmdlet to simulate heavy transactional load on a specified:
1 |
Test-Stress [-CacheName] [-Server] [-DataSize] [-GetsPerIteration] [-ItemsCount] [-ReportingInterval] [-SlidingExpiration] [-TestCaseIterationDelay] [-TestCaseIterations] [-ThreadCount] [-UpdatesPerIteration] [-Credentials] [-NoLogo] |
Alternatively, you can use the NCache Monitor to have a detailed overlook and identify any performance bottlenecks, ensuring optimal performance and high availability across the cluster.
Conclusion
Upgrading NCache offline is a seamless process, allowing users to transition from one version to another effortlessly. By upgrading, you can avoid compatibility issues and enjoy improved scalability and efficiency. So, do not miss out on the latest features, download NCache today and get the latest version to elevate your caching experience!