For the complete documentation index, see llms.txt. This page is also available as Markdown.

Scripts for creating blank databases

Command Centre Databases (SQL) › Creating blank ones using scripts (8.20 and above)

This page answers

  • Where are the create-database scripts on 8.20+ install media?

  • How do you run them with sqlcmd?

  • Why do the clients error afterward, and how do you fix the thumbprint?

Note: On a live site, detach and back up the existing databases before proceeding.

The 8.20+ install media no longer contains blank versions of CCFTCentral and CCFTEvent. Instead there are two SQL scripts that create them, on the install media under:

\Utilities\Database scripts
  • CreateCentralDatabase.sql: creates CCFTCentral

  • CreateEventDatabase.sql: creates CCFTEvents

The scripts cannot be run directly. They can be opened and executed in SSMS, but SSMS may not be installed on the CC server, so they can also be applied with sqlcmd from the command line. Log in as a local admin (or launch CMD as admin) and run:

sqlcmd -S CCserverName\instanceName -i SQLscriptLocation
sqlcmd executing in a CMD window to create the databases

Note: In the command above the -S switch is uppercase and the -i switch is lowercase. The switches are case-sensitive and affect how the command runs.

This creates and attaches the databases to the GALLAGHER instance. The database files are saved in the SQL program-files folder, which depends on the SQL version. For a default CC 8.20 install using x64 SQL 2017:

You could leave the databases there, but then detaching/attaching from CCFTServiceManager would no longer work and you would need SSMS. To move them to the default Gallagher data folder:

  1. Stop the Command Centre services.

  2. Use CCFTServiceManager to detach the databases.

  3. Copy the databases from the SQL program-files data folder (above).

  4. Paste them into the Gallagher data folder: C:\Program Files (x86)\Gallagher\Command Centre\Data

  5. Use CCFTServiceManager to attach the databases.

  6. Apply a new recovery code to the databases (see below).

  7. Start the Command Centre services.


Regenerating the thumbprint

At this point the services start, but launching the clients gives an error:

Thumbprint mismatch error when launching the CC client after attaching blank databases

The server thumbprint in the client config files no longer matches the thumbprint in the new blank databases, so the clients are no longer trusted by the server. To resolve:

  1. Launch CCFTRecoveryCode.exe and choose Generate a new code for this system.

  2. Use CCFTServiceManager to start the services.


Replacing the event database only

If you are only restoring CCFTEvent, the procedure is the same but run CreateEventDatabase.sql only, copy/replace CCFTEvent only, attach, and start services. No new recovery code is needed in this case; the clients should connect once the services start for the first time.


🔗 Related

Last updated

Was this helpful?