How toUninstallation Procedure

Uninstallation Procedure

Sana Commerce 8.1
Your provider

Uninstallation Procedure

There is no uninstaller program for Sana Commerce to automate the uninstallation procedure. Therefore, you should do it manually. The uninstallation procedure consists of the following steps:

  • Create a Backup of the Solution (Optional);
  • Cleanup the Data;
  • Restore the Standard Objects Modified for Sana Commerce;
  • Remove WCF Service;
  • Drop the Sana Commerce SQL Server Database;
  • Remove the NT Users (Single Server Installation Only);
  • Remove the Web Applications from the IIS (Single Server Installation Only);
  • Delete the Log Files;
  • Delete the Sana Commerce Source Code.

See detailed description of these steps below:

Create a Backup of the Solution (Optional)

You may want to create a backup of the Sana Commerce solution before uninstalling it if you plan to restore it again in future. For instructions on how to backup or restore Sana Commerce, please follow this link.

Cleanup the Data

At first it is required to cleanup the data used by SC in NAV before the removing of the objects from NAV. Sana Commerce provides a codeunit 'SC - Uninstall' with ID '11123399' which can be used to clear the data. This codeunit deletes the data from all the custom SC tables and clears the SC specific fields in the standard NAV tables. It also performs unpublishing of the 'SC - NAV2009 WebService' codeunit (object ID: '11123303') and deletes all the custom SC objects from NAV.

Find this codeunit in the Object Designer of NAV Client and run it by selecting it and clicking the 'Run' button. Close the NAV Classic Client and open it again in order to see the changes.

Restore the Standard Objects Modified for Sana Commerce

If some changes were done to the objects specified in the list of the changed objects in the 'Changed Objects Overview' chapter after the Sana Commerce solution has been installed, then skip this step.
Also, if you don't have the 'fob' or 'txt' file, which is described in the 'Backup Standard NAV Objects' paragraph, then skip this step too.

In both cases you must manually remove all the SC changes from the standard NAV objects modified by SC. In order to do this, refer to the 'Microsoft Dynamics NAV Changes' page on the help site. Remove the SC changes from the objects specified in the 'Changed Objects Overview' section and then remove the SC specific code according to the 'Code Changes on Standard Objects' section.

You can skip the entire paragraph 'Restore standard objects modified for Sana Commerce' in this case.

Step 1: Find the 'fob' or 'txt' file which contains the standard NAV objects and which was created during the installation of SC according to 'Backup Standard NAV Objects' paragraph of the 'Import NAV Objects' chapter. Open the help wizard, select your scenario and move to the needed chapter.

Step 2: Import the objects from this file (replace the existing objects when NAV client requests). By importing the objects from this file you roll back the objects changed by SC to their state before SC had been installed.

Remove WCF Service

If Sana Commerce connects to NAV 2009 via NAV 2009 Web Service, then this step can be skipped. It is applicable to the installations to use NAS only.

This step is only needed when there is only one installation of SC on the current machine. In case there are multiple SC installations on the same machine then this service component might be shared between multiple Sana Commerce NAV services and the removing of it will cause the other SC applications to stop working.

Step 1: Unregister the Sana Commerce NAV service. In order to do this open the Visual Studio 2008 command prompt and run the following command in it:

"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" Sana.Commerce.Navision.Service.dll /unregister
In the x64 environment the path to the .NET framework is different, therefore you should run the following command instead:
"C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe" Sana.Commerce.Navision.Service.dll /unregister

Step 2: Uninstall the Sana Commerce NAV service assembly from the GAC. For this run the following command in the Visual Studio 2008 command prompt:

gacutil /u Sana.Commerce.Navision.Service

Step 3: Delete the Sana Commerce NAV service's URL ACL from the URL ACL store. To do this, run the following command:

httpcfg delete urlacl /u #PROTOCOL#://#URL#:#PORTNUMBER#/navision/

Here #PROTOCOL#, #URL# and #PORTNUMBER# are the tags, that should be replaced by their corresponding values. These values should be exactly the same as the ones are used during the installation of the Sana Commerce NAV web service:

#PROTOCOL#: protocol type (HTTP or HTTPS)
#URL#: Change to: 
                      + : when the port registrations in the HTTP Server routing table are placed in the "Strong Wildcard" bucket;
                      [hostname] : when the port registrations are placed in the "Explicit" bucket;
                      [IP-address] : when the port registrations are placed in the "IP-bound Weak Wildcard" bucket;
                      * : when the port registrations are placed in the "Weak Wildcard" bucket.
#PORTNUMBER#: must be replaced by the port number on which the NAS is running.

For more information about routing incoming requests, please check http://msdn.microsoft.com/en-us/library/aa364687(VS.85).aspx.

Drop the Sana Commerce SQL Server Database

This step consists of two sub-steps: the dropping of the database and the deletion of the database login associated with it. To drop the SC database, take the following actions:

Step 1: Open the SQL Server Management Studio and connect to the database server, where the Sana Commerce SQL Server database is running.

Step 2: Right-click on the Sana Commerce database name and select the 'Delete' menu item.

Step 3: Click the 'OK' button in the confirmation window that opens.

To delete the database login associated with the SC database, which is described in the installation manual, do the following:

Step 1: In the SQL Server Management Studio open the 'SQL server instance > Security > Logins' in the Object Explorer panel.

Step 2: Locate the SQL Server Login which is used as a login for the Sana Commerce database.

Step 3: Make sure that this SQL Server Login is used only for the SC database which has just been dropped. If this login is also used for the other databases, then do not delete it and proceed to the next paragraph. Otherwise, if this login is used only for the SC database, then right-click on the Object Explorer and select the 'Delete' menu item.

Step 4: Click the 'OK' button in the window that opens to confirm the deletion of the login.

Remove the NT Users (Single Server Installation Only)

According to the Single Server Deployment 'Create NT Users' chapter two NT users were created, which are referred to as SC_Webuser and SC_Nasuser. These users must be deleted from the system.

In order to remove the local users, perform the following steps:

Step 1: Open the 'Computer Management' console available in 'Control Panel > Administrative Tools > Computer Management'.

Step 2: Expand the 'System Tools > Local Users and Groups > Users' node.

Step 3: One by one right-click on all the SC users in the right panel and select the 'Delete' menu item.

Step 4: For each user confirm the deletion by clicking the 'OK' button in the window that pops up.

In case the domain users are used instead of the local users, refer to the Active Directory help article.

Remove the Web Applications from the IIS (Single Server Installation Only)

Step 1: Find the Sana Commerce frontend website in the IIS Management Console.

Step 2: Right-click on the website node and select the 'Remove' submenu if you use IIS 7 or newer, or select the 'Delete' submenu if you use IIS 6. Check that the corresponding application pool is removed as well. Note that in IIS 5.1 or older it is not possible to remove the website.

Step 3: Confirm the deletion operation.

Step 4: If the Sana Commerce backoffice is installed as a separate website, but not as a virtual directory, then repeat the same steps for the backoffice as well.

Delete the Log Files

Step 1: Find the location where the log files are written by the SC web applications. This location is configured for the SC frontend and backoffice in their 'web.config' files. For the information on the logging configuration see the following chapters in the configuration guide: 'Enable Logging' and 'Logging in Task Scheduler'.

Step 2: Delete the folder with the SC log files completely.

Delete the Sana Commerce Source Code

Navigate to the folder where Sana Commerce has been installed and delete the Sana Commerce source code folder completely.

How toUninstallation Procedure