The following procedures describe in detail how to migrate the SQL database of the Microsoft Application Virtualization (App-V) Management Server to a different SQL Server.
This procedure requires that the App-V server service is stopped and this will prevent end-users from using their applications.
To back up the App-V SQL database
Open the Services.msc program and stop the App-V Management Server service on all Management Servers that use the database to be migrated.
On the computer where the App-V database is located, open SQL Server Management Studio.
Expand the Databases node and locate the App-V database (default name is APPVIRT).
Right-click the database and select Tasks and then select Back Up.
Verify that Recovery model is set to SIMPLE and the Backup type is set to Full. Change the Backup set and Destination settings if it is necessary.
Click OK to back up the database. After the backup has completed successfully, click OK.
Open Windows Explorer and browse to the folder that contains the database backup file, for example APPVIRT.BAK. Copy the database backup file to the destination computer that is running SQL Server.
To restore the App-V SQL database to the destination computer
On the destination computer, open SQL Server Management Studio, right-click the Databases node and select Restore Database.
Under Source for Restore, choose From device and then click the “…” button.
In the Specify Backup dialog box, make sure that the Backup Media is set to File and then click Add.
Select the backup file that you copied from the original computer that is running SQL Server, and then click OK.
Click OK and then click to select the backup set to restore.
Under Destination for restore, click the drop-down for To database and select the App-V database name, for example APPVIRT.
Click OK to start the restore. After the restore has completed successfully, click OK.
Expand the Security node, right-click Logins and select New Login.
In the Login Name field, enter the Network Service account details for the App-V Management Server in the format of DOMAIN\SERVERNAME$.
On the General page under Default database select the App-V database name, for example, APPVIRT, and then click OK.
Under Select a page, click to select the User Mapping page. Under Users mapped to this login, click the check box in the Map column to select the App-V database.
Under Database role membership for: <appvdatabasename>, click to select SFTEveryone and then click OK.
Make sure that the Windows Firewall on the new computer that is running SQL Server is configured to allow the App-V Management Server to access the system. Under Administrative Tools, use the Windows Firewall with Advanced Security program to create an Inbound Rule for the port that is used by SQL Server (default is port 1433).
To migrate the App-V SQL Server Agent jobs
On the original computer that is running SQL Server, in SQL Server Management Studio, expand the SQL Server Agent node, and then expand the Jobs node.
Right-click the following four App-V jobs and select Script Job as | CREATE to | File, and save each script to a folder and give each script a descriptive name.
Softgrid Database (appvdbname) Check Usage History
Softgrid Database (appvdbname) Close Orphaned Sessions
Softgrid Database (appvdbname) Enforce Size Limit
Softgrid Database (appvdbname) Monitor Alert/Job Status
Copy the four script files (.sql) to the destination computer that is running SQL Server and open SQL Server Management Studio.
In Windows Explorer, right-click each .sql file and then click Run. Each script will open in a query window in SQL Server Management Studio. Click Execute for each script and verify that each is completed successfully.
Refresh the Jobs node under the SQL Server Agent node and confirm that the four jobs are created successfully.
To update the configuration of the App-V Management Server
On the App-V Management Server, modify the following registry keys:
SQLServerName = <newservername>
SQLServerPort = <newserverport>
Then restart the App-V server service.
Browse to find the file SftMgmt.udl under the App-V Management Server installation directory (default is C:\Program Files\Microsoft System Center App Virt Management Server\App Virt Management Service). Right-click the file and select Open.
On the Connection tab, enter the name of the destination computer that is running SQL Server, and then click Test Connection. When the test is successful, click OK and then click OK again.
For App-V Management Server versions before 4.5 SP2, you must update the SQL Logging settings. Under Server Groups, right-click the server group the server is a member of and select Properties.
On the Logging tab click to select the SQL Database entry and then click Edit.
Change the DNS Host Name to the host name of the new computer that is running SQL Server and then click OK. Click OK two times more, and then restart the App-V server service.
Open the App-V Management Console, right-click the Applications node and select Refresh. The list of applications should be displayed as before.