> 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-moving-or-migrating-db-on-di.md).

# Moving or migrating

[Command Centre Databases (SQL)](broken://pages/cCfAltV0RyZ60G9YuhuO) › Moving or Migrating DB on different location

## This page answers

* How do you move the Command Centre databases to a different drive or folder?
* What SQL queries reattach them at the new location?

> Before starting, best practice is to always have a site backup and a working recovery code.

1. Stop the CCFT services.
2. Detach the databases and move the `.mdf` / `.ldf` files to the desired location.

![SSMS showing the CCFTCentral and CCFTEvent data and log files to move](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-2f709922c53a9027c4d3ce1a3981c2ee3d8ed823%2FSECHUB-CCS-SQL-MOVE-db-files-list.png?alt=media)

3. At the new location, open the folder's **Properties > Security** and change the user's privilege to **Allow**.

![Windows folder Properties Security tab granting the CCFT service account Allow](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-327b3268f50a82a3f58a310e832e86b6f1084fee%2FSECHUB-CCS-SQL-MOVE-folder-permissions.png?alt=media)

4. Open SSMS (SQL Server Management Studio) and run the attach queries below. The `N'...'` prefix is a fixed format; `E:` represents the new drive location followed by the folder path.

   ```sql
   CREATE DATABASE [CCFTEvent] ON
   ( FILENAME = N'E:\Data\CCFTEvent.mdf' ),
   ( FILENAME = N'E:\Data\CCFTEvent_log.ldf' )
   FOR ATTACH
   GO
   ```

![SSMS query window with the CREATE DATABASE CCFTEvent FOR ATTACH query](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-1ea739f5f6c97feb2cb1a121b637f0822aa647a4%2FSECHUB-CCS-SQL-MOVE-attach-event-db.png?alt=media)

````
```sql
CREATE DATABASE [CCFTCentral] ON
( FILENAME = N'E:\Data\CCFTCentral.mdf' ),
( FILENAME = N'E:\Data\CCFTCentral_log.ldf' )
FOR ATTACH
GO
```
````

![SSMS query window with the CREATE DATABASE CCFTCentral FOR ATTACH query](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-55c87b6c074ca5963bf335b5121b479c93659d04%2FSECHUB-CCS-SQL-MOVE-attach-central-db.png?alt=media)

5. Start the CCFT services.

> **Reminder:** Once you detach the database again after this, you will **not** be able to attach it using CCFT Service Manager. You will need to use SSMS to attach it.

***

🔗 **Related**

* [Databases - Detaching and Reattaching](/knowledge-hub/products/cc-software/configure/databases-an-overview-of-command-centr/databases-detaching-and-reattaching.md). The CCFTServiceManager path and its non-default-location limit.
* [Databases - An Overview of Command Centre and SQL](/knowledge-hub/products/cc-software/configure/databases-an-overview-of-command-centr.md). Service-account rights on the new folder.


---

# 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-moving-or-migrating-db-on-di.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.
