> For the complete documentation index, see [llms.txt](https://help.security.gallagher.com/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.security.gallagher.com/knowledge-hub/products/cc-software/configure/databases-an-overview-of-command-centr/databases-detaching-and-reattaching.md).

# Detaching and reattaching

[Command Centre Databases (SQL)](broken://pages/cCfAltV0RyZ60G9YuhuO) › Detaching and Reattaching

## This page answers

* How do you detach and reattach the Command Centre databases?
* Which tool applies to which Command Centre version?
* What are the restrictions on backup file locations?

> **Important:** If you are detaching or attaching databases from the SQL instance, **stop the Command Centre services first**.

***

## Version 6 and above: CCFTServiceManager

Version 6 and above ships a utility called `CCFTServiceManager.exe`. On the install media it is in the `Utilities` directory; later versions install it to the Bin folder by default:

```
C:\Program Files (x86)\Gallagher\Command Centre\Bin
```

The utility does many things; here it detaches and attaches the databases from the SQL instance.

![CCFTServiceManager showing the detach-database option](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-483f3165dbb012028ad51f304d57452e9b8a19ee%2FSECHUB-CCS-SQL-DETACH-service-manager-detach.jpg?alt=media)

![CCFTServiceManager showing the attach-database option](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-268798879b8bd82b7b95602162a1520c45ea3799%2FSECHUB-CCS-SQL-DETACH-service-manager-attach.jpg?alt=media)

> **Note:** If the databases are **not** in the default location, the utility detaches fine but will **not** reattach. See [Databases - Structure](/knowledge-hub/products/cc-software/configure/databases-an-overview-of-command-centr/databases-structure.md) for the default `Data` folder path.

### 7.70 and later: recovery code needed for attach

Attaching databases to a system that did not previously have those databases requires the **Recovery Code tool** in the Bin folder.

***

## Systems 5.21 and older: DB batch files

For older systems, use the Database Batch Files on the install media under:

```
Utilities\DB Batch Files\
```

Copy the entire `DB Batch Files` folder (including the folder itself) to the install path for early Command Centre versions:

```
C:\Program Files\Cardax\Command Centre\
```

Stop the Command Centre services, then run `DetatchDB.bat` to detach the databases from the SQL instance. The databases themselves are located at:

```
C:\Program Files\Cardax\Command Centre\DATA\
```

Copy the databases to a safe location. Run `AttachDB.bat` to reattach them.

> **Note:** If the databases are **not** in the default location, the batch file detaches fine but will not reattach; you will have to alter the batch file to suit.

***

## Backups (.FTBackup)

When you create a backup using the Command Centre backup functionality, it makes a copy of `CCFTCentral.mdf` in the form `filename.FTBackup`. These backup files are self-executing: double-clicking one launches the backup-restore utility.

> **Note:** Backups **cannot** be restored from user-specific folders (Desktop, My Documents, Downloads) or other restricted locations such as the root of the C: drive.

***

🔗 **Related**

* [Databases - Moving or Migrating DB on different location](/knowledge-hub/products/cc-software/configure/databases-an-overview-of-command-centr/databases-moving-or-migrating-db-on-di.md). Moving the files, then reattaching via SSMS.
* [Databases - Creating blank ones using scripts (8.20 and above)](/knowledge-hub/products/cc-software/configure/databases-an-overview-of-command-centr/databases-creating-blank-ones-using-sc.md). When you need the recovery code again.
* [Backups - An Overview](/knowledge-hub/products/cc-software/configure/archiving-and-backups/backups-an-overview.md). Taking and restoring backups.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.security.gallagher.com/knowledge-hub/products/cc-software/configure/databases-an-overview-of-command-centr/databases-detaching-and-reattaching.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
