Skip to Content
Mobile

Disaster recovery in Afaria 7

Tags:
Purpose
This document provides the reader with information on how to properly configure the backup of the Afaria Server, Afaria Administrator, and the Afaria Database Server that houses the Afaria database.
Note these steps need to be followed exactly or unintended
outcomes or instability can occur!

Assumptions
As the Afaria server configuration can be complex, successful backups and disaster recovery require a thought out plan. For this reason, the following assumptions should prepare an administrator for this task:
  1. The reader should be familiar with Afaria, IIS, and the Database Server platform that supports the Afaria database (MS SQL Server or SQL Anywhere).
  2. The account being used to install and move accounts is an Administrator account and all rights are assigned.
  3. The passwords for all relevant accounts must be known.
  4. This document refers to the default install directory as C:\Program Files (X86)\Afaria. If a custom installation directory is being used, that path should replace any instances of the default path in this document
  5. All certificates used in the Afaria installation are on hand and the administrator understands how to deploy these certificates. Certificates must also beavailable in the local certificate store. The person performing the restore knows how to place certificates in the store if necessary.
  6. The name of the server machine(s) are not changing. Due to certificate formats, the machine name and common names of certificates must match.
       
Back up planning

A successful disaster recovery policy requires a well-planned and tested backup procedure. This procedure should include the following: what to backup, directions for performing backups, when to perform backups, testing the backups, and directions for restoring the backup.

The document outlines proper procedures for backing up each element within an Afaria environment. It is not necessary to back up each element at the same time. If this plan is followed successfully the Server ID (Transmitter ID), Internal Channel IDs and Client GUID integrity will be maintained. Additionally, not all components since they use the Afaria Server and database for their information.
Backup

Afaria Server
A stand-alone Afaria server includes all the major components installed to a single machine. While a complete install of Afaria may include other component installs, data is only retained in the Afaria Server and the database.

1. Stop the Afaria Server services This can be accomplished by executing the following commands from the command line:
a. net stop “Afaria Server” /y
b. net stop “AfariaIPhoneServer” /y
c. net stop “Afaria Backend Portal Package Server” /y
d. net stop “Afaria API” /y
e. net stop “Afaria Client Service” /y
2. Stop any Relay Server Outbound Enabler services. The names of these services are customized by the installer and may vary by environment.

3. Record the installed Afaria hot fixes and services packs listed in the registry at the following locations:
HKEY_LOCAL_MACHINE\SOFTWARE\AFARIA\AFARIA\PATCH\

4. Export all Afaria Channels. Ensure that the option to include the content and assignments for each channel are selected:
c:\program files (x86)\Afaria\bin\xaexport.exe \ c:\backup.cmx /r
Note: This process can be accomplished by executing the following command through a Session Manager channel or by using a simple batch file. Optional automation of channel export can be done by creating a Windows Task Scheduler task that executes the Channel Exports on a daily basis. More information about the xaexport and xaimport tools can be found by using the “/?” option.
5. Export HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432node\Afariato a registry file (.reg). This preserves the unique Server ID
(Transmitter ID) and server settings that stored in the registry.
BACKUP THE FOLLOWING DIRECTORIES:
C:\PROGRAMFILES(X86)\AFARIA
C:\PROGRAMFILES(X86)\AFARIAAPISERVICE
C:\PROGRAMFILES(X86)\AFARIA COMMON
C:\PROGRAMFILES(X86)\AFARIAEUSSP
C:\PROGRAMFILES\AIPS
C:\PROGRAMFILES\PACKAGESERVER
Note: Backing up the Afaria server installation directory preserves all Channel IDs, Channel worklists, any worklist assignments, worklist priorities, etc.

6. Restart the Afaria Server service. This can be accomplished by executing the following commands from the command line:
a. net start “Afaria Server” /y
b. net start “AfariaIPhoneServer” /y
c. net start “Afaria Backend Portal Package Server” /y
d. net start “Afaria API” /y
e. net start “Afaria Client Service” /y
Relay Server Outbound Enablers
The Relay Server Outbound Enablers (RSOE’s) are an optional component to Afaria. If they are enabled there will be services for each RSOE for each IIS component. In order to make sure the configuration is maintained follow these steps:
1. Export any registry keys with the following nomenclature:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SQLANYe_*
Note: there may be none, or up to four services, which may mean there are four registry keys to export.

Database

Refer to Microsoft SQL or SQLAnywhere documentation for backing up the Afaria database. It is recommended that customers create a maintenance plan to run this backup on a scheduled basis. It is necessary to stop the Afaria Server service when performing a database backup in order to get a complete backup.
For SQL Anywhere please reference the following wiki for backup guidelines. Afaria Database Backup procedures with SQL Anywhere
Restoring the Stand-alone Server
Database

It is only necessary to restore the database if it was installed on same machine as Afaria Server or if the database is being moved to another server.
Refer to appropriate documentation for restoring a database for the Database Server platform in use for the environment. The Afaria Database must be restored prior to recovery of Server and/or Administrator. Ensure all user security accounts have been recreated and aliased properly per the “Installing Afaria Guide” for the appropriate version of the product.
Afaria Server
1. Edit the registry file (.reg) exported during the backup process, and modify it to contain only the “TransmitterId” key which will vary by server. Reference the screenshot for a sample. Then save the registry file. 

Please note this only refers to the server section of the registry key.   Please retain all other  sections, such as APIService, etc if present.
2. Import the newly modified registry file (.reg).

3. Restore the following entire directories that were backed up previously. Use appropriate path if your environment does not use the default locations:

a. C:\Program Files(x86)\Afaria

b. C:\Program Files(x86)\AfariaApiService

c. C:\Program Files(x86)\Afaria Common

d. C:\Program Files\AIPS

e. C:\Program Files\PackageServer

f. C:\Program Files(x86)\AfariaEUSSP\<VirtualDirectory>


4. Remove the web.config file located in the C:\Program Files\PackageServer\PS directory.


5. Install the Afaria Server and additional components (Enrollment Server, Package Server, and Self-Service Portals) from the CD/Installation
image using the default options. This will ensure the service account name, password, and authentication/assignments are being used as they were in the original Afaria Server system. If the Database server is changing, ensure that the new values for the server are being used.
6. Reinstall the Afaria API.
7. Import the Afaria Channels from export file (.cmx) using the Afaria Channel Administrator.
8. Apply the same Afaria Hot Fixes and/or Service Packs noted for the server.
9. Place any certificates required back into the correct locations.
Relay Server – Outbound Enablers
Restore any registry keys with the following nomenclature to restore the RSOE Services:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SQLANYe_*
Note: there may be none or up to four services to import.
Considerations for Afaria Farms
An Afaria Server Farm configuration is defined as an environment that has one master and one or more farm servers installed. All channels are setup on the Master and then are replicated to each server participating in the farm. One of the benefits of a farm environment is that if a master system goes down, clients can continue to connect to the farm servers. Channels cannot be created on slave systems.

Farm Server
Follow the same guidelines outlined above for “Backing Up and Restoring a Stand-Alone Server Environment”.
Farm Server
Administrators should include the following steps for their Disaster Recovery in their environment:

1. Follow normal system backup procedures for any Windows Server.

2. Prior to reinstallation, remove the row correlating to the farm server system from the A_SERVER table in the Afaria database.

3. Reinstall the Afaria software on the farm server(s) pointing to the current location of the database.

4. By pointing to the database, the server will automatically install as the role of a Afaria Farm Server system.

Once reinstalled, verify the Farm relationship from the Master server.
Results

By following a well-planned and tested disaster recovery process, vital core functions can be maintained and returned to full working status in a prompt and complete manner.

No comments