Feb
7
2010

Migrating SQL databases if during the initial Citrix installation the default database was selected

Migrating SQL databases if during the initial Citrix installation the default database was selected and you want to change it from Master to something else, here are the steps that should be taken:

SQL Server:
Create a Citrix database called CTX, create a SQL user called citrix and grant the user dbo database access.
First Citrix Server:
1. From a command prompt cdprogram filescitrixindependent management architecture
2. copy mf20.dsn mast.dsn
Contents of mast.dsn:
ODBC
DRIVER=SQL Server
UID=sa
DATABASE=master
WSID=CTXSERVERNAME
APP=Citrix IMA
SERVER=SQLSERVERNAME
Description=Citrix
This assumes the sa SQL account was used to connect to the database. If DATABASE isn’t a part of this configuration then Citrix knows to default to master.
WSID=Name of the server
SERVER=Name of SQL server
3. edit mf20.dsn
Contents of mf20.dsn:
ODBC
DRIVER=SQL Server
UID=citrix
DATABASE=ctx
WSID=CTXSERVERNAME
APP=Citrix IMA
SERVER=SQLSERVERNAME
Description=Citrix
4. dsmaint config /user:sa /pwd:sapassword /dsn:"c:program filescitrixindependent management architecturemast.dsn"
This tells Citrix what DSN to use. For this example we’re telling it to temporarily use the MAST.dsn
5. dsmaint migrate /srcdsn:"%ProgramFiles%CitrixIndependent Management ArchitectureMAST.dsn" /srcuser:sa /srcpwd:sapassword /dstdsn:"%ProgramFiles%CitrixIndependent Management ArchitectureMF20.DSN" /dstuser:citrix /dstpwd:citrixpassword
This copies the necessary tables from the source DSN to the destination DSN. The MAST.dsn looks at the master database in SQL and the MF20.dsn goes to the CTX database.
6. dsmaint config /user:citrix /pwd:citrixpassword /dsn:"c:program filescitrixindependent management architecturemf20.dsn"
This tells Citrix what DSN to use. For this example we’re telling it to use the MF20.dsn which will be used for production.
7. Stop IMA service
8. dsmaint recreatelhc
Flushes all the local host cache info out and pulls in a fresh copy from SQL
9. Start IMA service
Other Citrix Servers:
1. Copy the MF20.dsn from the first server to other servers and edit the WSID so that it’s the same as the server name
2. dsmaint config /user:citrix /pwd:citrixpassword /dsn:"c:program filescitrixindependent management architecturemf20.dsn"
3. Stop IMA service
4. dsmaint recreatelhc
5. Start IMA service
Master Database Cleanup:
This is so it’s not used accidentally
rename keytable _keytable
rename indextable _indextable
rename deletetracker _deletetracker
rename datatable _datatable
To test that everything worked properly, published a test application like Freecell using the Citrix Management Console and launch it from servers in the farm and if installed from the web interface. To make 100% sure everything works, reboot the servers and confirm no errors are in the event logs.
Originally posted on http://nevadacitrix.com/faq.htm

About the Author:

Comments are closed.