Recently we were faced with moving a Citrix Presentation Server 4.0 datastore from SQL Server 2000 to an install of SQL Server 2008 R2. Many articles were found discussing different ways to accomplish this task with mixed results. The path we chose worked wonderfully for a small number of Citrix servers. For larger environments this process could be scripted to automate the tasks involved. Read more for the step-by-step guide.

<!--more--> 1. Stop imaservice Service on all Farm Citrix Servers.

2. Ensure SQL Server Native Client 10 is installed on all Citrix Servers.

3. Using sp_detachdb, detach Citrix datastore database from source SQL Server.

4. Copy .mdf and .ldf files to new location on target SQL Server.

5. Using sp_attachdb, attach Citrix datastore database to target SQL Server.

6. Create security login to match existing login from source SQL Server.

7. Run stored procedure on target SQL Server <span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">sp_change_users_login with Action of 'Update_One' to realign database and server logins.</span> <!-- [if gte mso 9]&gt;  Normal 0     false false false  EN-US X-NONE X-NONE            MicrosoftInternetExplorer4              &lt;![endif]--><!-- [if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><!-- [if gte mso 10]&gt;   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} --> <!-- [endif]-->

<span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">8. Rename MF20.dsn (likely stored at </span> <span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">C:Program FilesCitrixIndependent Management Architecture) to, for example, MF20.dsn.old</span> <!-- [if gte mso 9]&gt;  Normal 0     false false false  EN-US X-NONE X-NONE            MicrosoftInternetExplorer4              &lt;![endif]--><!-- [if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><!-- [if gte mso 10]&gt;   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} --> <!-- [endif]-->

<span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">9. Execute the following command on each Citrix Server:</span>
<p style="padding-left: 30px;"><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">dsmaint config </span> <span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">/user:DBUser /pwd:DBUserPassword /dsn:” c:Program FilesCitrixIndependent Management ArchitectureMF20.dsn”</span> <!-- [if gte mso 9]&gt;  Normal 0     false false false  EN-US X-NONE X-NONE            MicrosoftInternetExplorer4              &lt;![endif]--><!-- [if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><!-- [if gte mso 10]&gt;   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} --> <!-- [endif]--></p>

<span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">10. Execute the following command on each Citrix Server:</span>
<p style="padding-left: 30px;"><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">dsmaint recreatelhc</span></p>

<span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">11. Start imaservice Server on all Farm Citrix Servers.</span>

<span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">Does anyone have an alternative method they'd had success with? Please share!
</span>
<p class="MsoListParagraph" style="margin-left: 1in; text-indent: -0.25in;"><span></span></p>