# Steps for version update

### Pre-Uninstall Steps

* Take a backup of Cloud Assert billing database.
* Take a backup of the following files from their respective locations.

| File Name                                       | File Path                                                               |
| ----------------------------------------------- | ----------------------------------------------------------------------- |
| Web.config                                      | C:\inetpub\MgmtSvc-CloudAssertBilling                                   |
| License.cal                                     | C:\inetpub\MgmtSvc-CloudAssertBilling\bin                               |
| CloudAssert.WAP.Billing.AgentService.exe.config | C:\ProgramFiles\CloudAssertBilling\CloudAssert.WAP.Billing.AgentService |
| web.config                                      | C:\inetpub\AzureStack-BillingAdminExtension                             |
| web.config                                      | C:\inetpub\AzureStack-BillingTenantExtension                            |
| Web.config                                      | C:\inetpub\AzureStack-BillingRP                                         |

### Uninstallation Steps

* Uninstall existing Usage and Billing installers from Add or Remove Programs on the resource provider machine.
* Delete ‘CloudAssertBilling’ from ‘C:\Program Files’ if present after uninstalling Billing Agent Service setup.

### Installation Steps

* Extract the billing installers to a desired location
* To install the Billing API and Agent service components via command line, download the ‘setup.bat’ file [here](https://cloudassertdownloads.blob.core.windows.net/usage/setup.bat)
* Copy the initialize.ini file from the following location ‘C:\Packages\Plugins\Microsoft.Powershell.DSC\2.19.0.0\DSCWork\setupBillingConfiguration.0\AzureStack.Billing.Setup.1.0.0\content\Setup\Packages’
* Place ‘setup.bat’ and ‘initialize.ini’ (which are acquired from the above steps) files in the folder where the billing installers have been extracted.

#### Install Billing API Service

* Open a command prompt as administrator.
* Navigate to the billing installers folder.
* Run ‘setup.bat install-api’.

#### Install Billing Admin Extension

* In the command prompt, change the directory to the AdminExtension folder
* Run the command “CloudAssert.AzureStack.Billing.AdminExtension.deploy.cmd /y”

**Install Billing Tenant Extension**

* In the command prompt, change the directory to the TenantExtension folde
* Run the command “CloudAssert.AzureStack.Billing.TenantExtension.deploy.cmd /y”

#### Install Billing RP

* In the command prompt, change the directory to the RP folder
* Run the command “CloudAssert.MAS.Billing.ResourceProvider.deploy.cmd /y”

#### Install Billing Agent Service

* Refresh the admin/tenant portal and verify that Billing extension is working fine
* Open a command prompt as administrator
* Navigate to the billing installers folder
* Run ‘setup.bat install-agent’.

### &#xD;Post Installation Steps

* Download the Billing Tool [here](https://cloudassertdownloads.blob.core.windows.net/usage/MASBilling2.1.10.19/BillingTool.zip) and extract it
* Open a command prompt as administrator
* Navigate to the billing tool folder
* Run the ‘UpdateDatabase’ command in BillingTool.exe as below,

![](https://3192639269-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnRvmq3Z7NHbI7KSziq%2F-LnSyLXsrVsleCNQR8CO%2F-LnSycpDkfBB49fQjlsp%2Fimage.png?alt=media\&token=6e10ab77-f5a1-4f6e-b748-5e3a8c69b142)
