Advisory · Projects · Speaking LinkedIn GitHub Credly IT EN

Migrations · Citrix

CVAMT – Citrix Virtual Apps Migration Tool

As a Citrix consultant, I often work on Citrix farm migrations, and as a result I frequently need to automate copying the published applications from the old infrastructure to the new one.

So I developed a PowerShell tool that simplifies the migration of published applications, letting you define granularly what to migrate and in which destination Delivery Groups to create the published apps.

The tool was built on top of PowerShell scripts shared by the Community, so it’s free for anyone who wants to use it.

Initial tool configuration

The tool relies on the native PowerShell commands that Citrix exposes through its SDK. If the tool runs on a VM where the SDK is already installed, it shows the message “Citrix Snapin loaded”; otherwise the program shows a button to download the required SDK package. The tool must be run by a user with access permissions to the farms.

Export from the source farm

In the “Export from Farm 1” section, by entering the hostname or IP of a controller, you can export the applications in both Delivery Groups and Application Groups.

Import into the destination farm (On-Prem)

Moving to the “Import in Farm 2” section, clicking the “Load” button loads all the exports done previously (stored in the temporary folder configured in the first tab). You can select the applications you want to import one by one, or click “Select All” to select all the applications available in the selected Delivery/Application Group.

Enter the hostname or IP of a controller in the destination farm, connect, select a destination Delivery Group and import the applications you selected earlier.

Import into Citrix Cloud

Exactly the same operations available for importing into an on-prem farm are also available for Citrix Cloud. Unlike on-prem authentication, with Citrix Cloud you need to authenticate by loading a secureclient.csv file (generated from the citrix.cloud.com portal) and providing the CustomerId of the Cloud tenant in use.

One of the problems I ran into while using Citrix Cloud is that you can’t upload the .ico files you want when publishing custom applications (the ones that aren’t picked up automatically from the Start menu of an existing machine).

If you want to publish a new application that isn’t in the Start menu, these are the only icons you get:

Citrix Cloud change Application icon

As you can see, unlike the on-prem Citrix Studio, you can’t select any icons other than the 9 available ones. The only option is to change the icon with PowerShell commands.
So in CVAMT I added the ability to select applications previously published in Citrix Cloud and replace their current icon. This way you can publish applications with the icons you want.

Uploading a custom icon

If the source and destination farms can’t both be reached from the same VM, just copy the contents of the temporary folder (where the exports were saved) to a temporary folder on another VM and run the import from there. Of course, if the AD domains are different, there’s no guarantee that any users/groups assigned to the applications will be imported.

Update, May 22, 2020:
I noticed that the tool freezes on several occasions when it’s run directly on a Delivery Controller. The PowerShell calls were written to run on a VM with the CitrixPoshSdk package installed:
https://download.apps.cloud.com/CitrixPoshSdk.exe
This package is different from the SDK installed by default along with Citrix Studio, so that could be the reason for the freezes. I’ll look into it more closely over the next few days.

The features of this tool come with no guarantee. I will not be held responsible for any malfunctions and/or problems resulting from the use of this tool. I recommend manually checking the migrated resources once the migration is complete.

Here’s the link to the repository for the download:

Changelog

1.0.0.20
  • April 20, 2020AddFirst release
  • April 20, 2020Updateimport into Citrix Cloud not fully implemented
1.0.0.25
  • April 21, 2020AddCitrix Cloud import implementation completed;
  • April 21, 2020UpdateGUI freeze fixes and various optimizations;
1.0.0.26
  • April 22, 2020AddFixed GUI freeze during import into Citrix Cloud; GUI optimization.
1.0.1.2
  • April 24, 2020AddAdded icon change feature in Citrix Cloud