The test migrates a Xendesktop7.5 database to the new SQL Server, which is made up of a single server, uses a singleton database, and hosts the store.
First, look at the existing database connection situation, start PowerShell in the DDC, add XenDesktop snapins:
Add-pssnapin citrix.*
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4A/FA/wKiom1Qni1qCpf6vAAEkm4byH-A700.jpg "title=" Capture 1. PNG "alt=" Wkiom1qni1qcpf6vaaekm4byh-a700.jpg "/>
View XenDesktop's three databases: site, log, monitor
Get-logdatastore
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4A/FA/wKiom1QnjADgqYamAAMM_8NMNt4614.jpg "title=" Capture 2. PNG "alt=" Wkiom1qnjadgqyamaamm_8nmnt4614.jpg "/>
Get-monitordatastore
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4A/FB/wKioL1QnjDqBI0nWAAI8uS92ZUQ295.jpg "title=" Capture 3. PNG "alt=" Wkiol1qnjdqbi0nwaai8us92zuq295.jpg "/>
Here we see that the returned results are located on the original database server, which is also the default configuration after XenDesktop installation, with only one database.
You can also see the configuration of these three databases in the configuration window on the DDC console.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4A/FC/wKioL1QnjXDDYuFEAAD0Wp76mT8925.jpg "title=" Capture 4. PNG "alt=" Wkiol1qnjxddyufeaad0wp76mt8925.jpg "/>
We continue to create a new connection string $cs to point to the database named Citrixjssh of the new database server jssh-sv-sql0a.jssh.com, note that both SQL Server installations use the default instance
$cs = "Server=jssh-sv-sql0a.jssh.com;;i Nitial catalog=citrixjsshxa7;integrated Security=true "
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4A/FC/wKioL1QnjknjQam-AACWB9bgjw4379.jpg "title=" Capture 5. PNG "alt=" Wkiol1qnjknjqam-aacwb9bgjw4379.jpg "/>
To disable configuration logging for a site:
Set-logsite-state Disabled
Empty all database connections
Note: The order of these commands is important, such as setting up a management service such as a core service before other related services will prevent you from disconnecting services that depend on it, or null.
Set-logdbconnection-datastore logging-dbconnection $null
Set-monitordbconnection-datastore monitor-dbconnection $null
Set-monitordbconnection-dbconnection $null
Set-acctdbconnection-dbconnection $null
Set-provdbconnection-dbconnection $null
Set-brokerdbconnection-dbconnection $null
Set-envtestdbconnection-dbconnection $null
Set-sfdbconnection-dbconnection $null
Set-hypdbconnection-dbconnection $null
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4A/FC/wKioL1Qnj--Dq3NOAANcJZpIaCw223.jpg "title=" Capture 6. PNG "alt=" Wkiol1qnj--dq3noaancjzpiacw223.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4A/FC/wKioL1QnkG_yuZ1CAAJZS4EQ3gM915.jpg "title=" Capture 7. PNG "alt=" Wkiol1qnkg_yuz1caajzs4eq3gm915.jpg "/>
Note: To set the remaining core services (configuration, log, and Administrator) database connections to NULL, you must use "-force" to enforce parameters or take the database offline.
Set-configdbconnection-dbconnection $null-force
Set-logdbconnection-dbconnection $null-force
Set-admindbconnection-dbconnection $null-force
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4A/FC/wKioL1QnkIXilB_LAAHl1icOZQU971.jpg "title=" Capture 8. PNG "alt=" Wkiol1qnkixilb_laahl1icozqu971.jpg "/>
Now that we've disconnected from the original database, we can back up the database.
You can use SQL Studio to make a full backup of the original database and then restore it on the new database (process slightly)
XenDesktop uses the computer account of the DDC server for direct access to the database, so we must create a computer login account on the new SQL Server and use SQL Studio to execute the query command:
Create login [jssh_server01\jssh-sv-xd7ddc$] from Windows
Now that the database has been migrated to the new SQL Server, we can connect the DDC to the new database and re-enable the configuration logging for the XD site.
Connect the DDC to the new database:
Set-configdbconnection-dbconnection $cs
Set-admindbconnection-dbconnection $cs
Set-logdbconnection-dbconnection $cs
Set-acctdbconnection-dbconnection $cs
Set-brokerdbconnection-dbconnection $cs
Set-envtestdbconnection-dbconnection $cs
Set-hypdbconnection-dbconnection $cs
Set-monitordbconnection-dbconnection $cs
Set-provdbconnection-dbconnection $cs
Set-sfdbconnection-dbconnection $cs
Set-logdbconnection-datastore logging-dbconnection $cs
Set-monitordbconnection-datastore monitor-dbconnection $cs
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4A/FD/wKioL1Qnk7igOyT1AAKb-y_LRxM006.jpg "style=" float: none; "Title=" Captures 9. PNG "alt=" Wkiol1qnk7igoyt1aakb-y_lrxm006.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4A/FB/wKiom1Qnk5CDZMDiAALKABURjus458.jpg "style=" float: none; "Title=" captures 10. PNG "alt=" Wkiom1qnk5cdzmdiaalkaburjus458.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4A/FD/wKioL1Qnk7qAQipWAAF2qvCJVRE817.jpg "style=" float: none; "Title=" captures 11. PNG "alt=" Wkiol1qnk7qaqipwaaf2qvcjvre817.jpg "/>
Re-enable configuration logging for the XD site:
Set-logsite-state Enabled
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4A/FD/wKioL1Qnk9mA2cPZAABvt4NaeD4818.jpg "title=" capture 12. PNG "alt=" Wkiol1qnk9ma2cpzaabvt4naed4818.jpg "/>
Run the test tool from the installation CD to make sure it works:
$testString = Get-brokerdbconnection
Test-brokerdbconnection $testString | Fl
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4A/FB/wKiom1Qnk_uz4gUpAAEGxXcg8N8332.jpg "title=" Capture 13. PNG "alt=" Wkiom1qnk_uz4gupaaegxxcg8n8332.jpg "/>
At this point, the migration is completed, check whether the work is normal operation, the original database server can be deleted.
This test reference http://blogs.citrix.com/2014/02/05/xendesktop-7-x-database-migration/
This article is from the "Learning Corner" blog, please be sure to keep this source http://aiguo.blog.51cto.com/1318036/1558996
XenDesktop 7.5 Database Migration and recovery