This article discusses the maintenance issues that you might experience while administering a Presentation Server farm and is a supplement to the administrator’s guide. Refer to the administrator’s guide for updated information pertaining to any of the following strategies before implementation.
This article is divided into the following sections:
This section discusses methods for Backing Up and Recovering the XenApp Farm Data Store (Access Data Store).
While there is no built-in backup scheduler with Access, Presentation Server includes the DSMAINT BACKUP command for backing up Access Data Stores only. Citrix recommends that this command must be executed daily using a scheduler script.
Warning! Do not attempt to back up Microsoft SQL Server or Oracle databases using this command.
Access to a valid backup or copy of the Data Store is assumed before starting the following procedure.
Moving an Access Database
To move an Access database, complete the following procedure:
Copy the Data Store file named “MF20.mdb” in the "%system%\Program Files\Citrix\Independent Management Architecture\" folder from the source server to the target server, which will be the new Data Store host.
On the new host server, create a new File DSN using the Microsoft ODBC manager pointing to the Data Store, as shown in the following screen shots:
Close the ODBC manager because you have created the required DSN file. Next, edit the registry settings.
Caution! Refer to the Disclaimer at the end of this article before using Registry Editor.
Run the Registry Editor and change the value of the following registry key from <blank> to "ImaAccess.dll":
HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\DatabaseDriver
Open the Command Prompt and run the following command to configure IMA and use the new DSN file:
dsmaint config
Example:
dsmaint config /user:domain\citrix /pwd:citrix /dsn:<full path to the newly created DSN file from Step 2>
Note: You can drag and drop the DSN file into the Command Prompt to avoid typing the wrong path.
Run the following command from the Command Prompt to stop the IMA Service and recreate the Local Host:
dsmaint recreatelhc
Also run the below command, if you are facing issues in restarting the IMA service:
dsmaint recreaterade
On all the remaining servers in the farm, run the following command, where <DirectServername> is the name of the new host server:
dsmaint failover <DirectServername>
Restoring an Access Database
It is assumed that the following tasks are completed before starting the procedure to restore an Access database:
You have rebuilt or reinstalled XenApp to recover from a failure.
You have a working XenApp server up and running with IMA started.
You have access to a backup copy of the old Access data base (MF20.mdb) that DSMAINT BACKUP command or some other method has created.
To restore an Access database, complete the following procedure:
Stop the IMA Service and copy the existing "MF20.mdb" file to a safe location.
Note: You will be replacing this file with the backup "MF20.mdb".
Copy the Data Store file named “MF20.mdb” from the backup source to the target server and save it in the "%system%\Program Files\Citrix\Independent Management Architecture\" folder.
Note: The IMA Service must be stopped before starting the next task.
Open a Command Prompt and run the dsmaint config command to configure IMA and use the existing "MF20.dsn" file.
Example of the preceding command:
dsmaint config /user:domain\citrix /pwd:citrix /dsn:<full path to the .dsn file >
Note: You can drag and drop the DSN file into the Command Prompt to avoid typing the wrong path.
Run the following command from the command prompt to recreate the Local Host cache and any other servers in the farm so that they are aware of the new information:
dsmaint recreatelhc
Also run the below command, if you are facing issues in restarting the IMA service:
dsmaint recreaterade
Note: Do not forget to stop IMA before you run the preceding commands.
This procedure is similar to the previous section. Refer to the respective administrator's guide for the version of XenApp you are using.
To back up and restore Microsoft SQL Desktop Engine (MSDE), complete the following procedure:
Run the dsmaint backup command to back up the MSDE Data Store.
Typing dsmaint backup /? from the Command Prompt provides the expected syntax parameters.
Specify the complete path to the backup location of the Data Store backup files. Essentially, this command uses a default OSQL script to back up the database.
Note: It is possible to create customized OSQL scripts for backups. However, this option is suggested only for experienced users and DBAs. The following Microsoft article provides details regarding this topic - How to back up a Microsoft Data Engine database by using Transact-SQL.
To restore an MSDE Data Store, run the command, dsmaint recover.
Caution! Do not try to recover the Data Store with the DSMAINT RECOVER command without verifying that the "Mf20.bak" file exists. Because this command removes the existing "Mf20.mdb" file from the server. If the "Mf20.bak" file does not exist, run dsmaint backup again.
In SQL 2005 Express Edition, you now have the ability to schedule backups and manage restores by using the SQL 2005 Express Management Studio tool.
Complete the following procedure to schedule backups and manage restores:
Download and install the prerequisite file from Microsoft Core XML Services (MSXML) 6.0 page.
Download and install the package, Visual Studio Express, which includes a required Microsoft XML Parser, to update the XML services.
Download and install SQL Server Management Studio Express. It provides tools that enable you to manage SQL Server Express, which are not included with the standard installation.
When using a Microsoft SQL Server or Oracle Data Store, consult the database server product documentation for scheduling automated backups of the Data Store. In most cases, daily backup is sufficient to prevent loss of farm data.
In a situation where a Citrix Data Store must be restored to another database server because the original is no longer available or has experienced a catastrophic failure, the most effective method is to use a full backup of the Data Store and restore it to the new database server (SQL or Oracle). In addition, each XenApp server requires the ODBC DSN file to be reconfigured or recreated and the IMA service must be reconfigured to use the new DSN file. The reconfiguration process of IMA creates updated registry information that the XenApp servers need to connect to the new database server.
Important: Because this scenario assumes the Citrix Data Store is unavailable, the following procedure must be performed within the same change window and it is strongly recommended that no administrative changes be attempted until the database is back online on a new database server. Attempting changes causes writing to the database resulting in failures because the database is not accessible.
On the destination database server, restore the most recently available database backup.
On a XenApp Server (preferably a Zone Data Collector), create a new or modify the existing DSN file to point to the new database server. Refer to the Microsoft ODBC Manager documentation for information about how to create a DSN file or consult the database administrator for assistance.
When the DSN file is created and tested using Microsoft ODBC manager, you must reconfigure the IMA service using the dsmaint config command.
Run the command, dsmaint config /? from the Command Prompt for exact syntax requirements.
The sample of the preceding command, is shown in the following screen shot:
Note: You can drag and drop the DSN file into the Command Prompt to avoid typing the wrong path.
Run the following command to stop the IMA Service and recreate the Local Host Cache:
dsmaint recreatelhc
Also run the below command, if you are facing issues in restarting the IMA service:
dsmaint recreaterade
Start the IMA Service.
Note: When the IMA Service is started successfully, if you would like to verify the new settings, then use the following registry settings: HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\DataSourceName
Copy the DSN file created in Step 3 to all the servers in the farm and repeat Steps 3.1 through 5.
When the IMA Service starts after restarting the server, it establishes a connection to the Data Store and performs various reads to update the local host cache. These reads can vary from a few 100 kilobytes of data to several megabytes of data, depending on the size and configuration of the farm.
To reduce the load on the Data Store and to reduce the IMA Service start time, Citrix recommends maintaining cycle boot groups of no more than 100 servers. In large farms with hundreds of servers, or when the database hardware is not sufficient, restart servers in groups of approximately 50, with at least a 10 minute interval between groups.Note: If the Service Control Manager reports that the IMA Service could not be started during a cycle boot of a Presentation Server but the service eventually starts, ignore this message. The Service Control Manager has a time-out of six minutes. The IMA Service can take longer than six minutes to start because the load on the database exceeds the capabilities of the database hardware. To eliminate this message, try rebooting few servers at one time.
Presentation Servers require the use of the chfarm command to change farm membership. For detailed use of the chfarm command, refer CTX736659 ‑ How to Change Farms Using the CHFARM Utility.
Refer CTX101877 ‑ Error: An error occurred while attempting to start the IMA Service for more information.
Running the chfarm command performs the following actions on the host server:
Attempts to remove the server from the farm.
Stops the IMA Service.
Evokes the IMA configuration wizard of the Presentation Server installation program.
Create a "New Server Farm" or "Join an Existing Farm":
To "Create a New Server Farm", the Data Store Configuration page presents options for the Data Store.
To "Join an Existing Farm", the Data Store Type page presents options for direct or indirect connection to the Data Store.
When creating a "New Server Farm", you must type a "New Farm Name". When "Joining an Existing Farm", you must type the information necessary to connect to the existing Farm Data Store.
The wizard prompts for the name of the zone in which to place this server. If left at "Default", the server will be added to a new zone which will be named after the server’s subnet IP address.
On the final screen of the wizard a "grayed out" field with the Farm Name is displayed.
Important: When "Joining an Existing Farm", if the Farm Name is not displayed in this "grayed out" field on the last screen, do not proceed. The credentials you entered for IMA to connect to the Data Store are invalid. Confirm if the user account and password are correct.
The IMA Service is started and the new information is written to the registry in the "HKLM\Software\Citrix\IMA and HKLM\Software\Citrix\IMA\Runtime".
Ensure that there are no users logged on before executing the chfarm process.
Because chfarm deletes the Access Data Store database on the server hosting the Access database, do not run chfarm on this server until all other servers in that farm are moved to a new farm. Failure to follow this process causes errors when attempting to execute chfarm on those servers that no longer have a valid Data Store.
Use chfarm on a member server that will host the new data store first. Then run chfarm on all other servers to join them to the newly created farm.
Close all connections to the Access Management Console and the Presentation Server Console on the local server before executing the chfarm command.
Note: Using chfarm command does not migrate the published applications or any server settings to the new server farm.
The best practice for removing a server from a farm is to uninstall the server through the Control Panel using the Add/Remove Programs applet while the server still has a connection to the farm. The uninstall sequence is designed to remove all Presentation Server registry keys, files, and all references to that server in the Data Store, including published applications, load management rules, trust relationships, and so on.
Important: For a farm that uses an Access Data Store, uninstall the server that hosts the Data Store last. Failure to do so prevents the installation process from completing successfully on the other farm servers. If the uninstallation fails, it might be necessary to perform a "forced uninstall". Therefore, refer the procedure described in CTX746354 ‑ Best Practices to Uninstall XenApp/Presentation Server on Windows Server.
For detailed information and instructions on migrating Farm Data Stores, refer to CTX123111 ‑ Data Store Migration Strategies.
CTX125140 - FAQ: Does Dsmaint failover work with XenApp 6?
CTX121888 – Data Store Migration Between Different Database Products