---
title: "Walkthrough: Moving security data to a separate database"
slug: "walkthrough--moving-security-data-to-a-separate-database"
abstract: "How to move security data from the Core database to a separate Security database."
---
# Walkthrough: Moving security data to a separate database

If you use Sitecore security on your Content Delivery (CD) server, you might want to optimize your setup by using a dedicated Security database. To do this, you must move the Sitecore membership objects from the Core database to a new database.

The `Scripts for Sitecore Security database` package that is available on the [Sitecore download site](https://dev.sitecore.net/Downloads/) helps you accomplish this. The batch files included in the package move Sitecore membership objects from the Core database to a dedicated Security database.

You can use an existing Security database or create a new Security database.

The package contains these batch files:

- `0- create empty database (Optional).bat`
- `1- create security database tables.bat`
- `2- Migrate membership data from core database to security database.bat`
- `3- drop membership objects from core database.bat`

> [!note]
> When you run each batch file, it prompts you to enter the SQL server name, database name, userid, and password needed for the procedure.

This walkthrough tells you how to:•

- [Create a Security database (optional)](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/walkthrough--moving-security-data-to-a-separate-database.html#UUID-09203010-5ec2-7fb8-1433-c3722e264e0d_section-5d4c24210d70f-idm46347595814752 "Create a Security database (optional)")
- [Create the Security database objects](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/walkthrough--moving-security-data-to-a-separate-database.html#UUID-09203010-5ec2-7fb8-1433-c3722e264e0d_section-5d4c24992d25a-idm44897683333520 "Create the Security database objects")
- [Migrate membership data from the core database to the Security database](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/walkthrough--moving-security-data-to-a-separate-database.html#UUID-09203010-5ec2-7fb8-1433-c3722e264e0d_section-5d4c25f94d579-idm45315528992048 "Migrate membership data from the core database to the Security database")
- [Remove membership objects from the core database](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/walkthrough--moving-security-data-to-a-separate-database.html#UUID-09203010-5ec2-7fb8-1433-c3722e264e0d_section-5d4c2681f3bc8-idm46002746939216 "Remove membership objects from the core database")
- [Update the Security connection string](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/walkthrough--moving-security-data-to-a-separate-database.html#UUID-09203010-5ec2-7fb8-1433-c3722e264e0d_section-5d5143970bc13-idm46002744869760 "Update the Security connection string").

## Create a Security database (optional)

If you do not have a Security database, you must create one. To create a new, empty Security database:

- Run the `0- create empty database (Optional).bat` batch file.

> [!note]
> The batch file only creates the database. It does not populate the database with tables, views, or stored procedures.

## Create the Security database objects

The Security database must contain these objects:

![image2.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/100/platform-administration-and-architecture/images/image2.png)

The objects include tables, views, and stored procedures related to membership data.

To create these membership objects in an empty Security database:

- Run the `1- create security database tables.bat` batch file.

## Migrate membership data from the core database to the Security database

To copy the existing membership data from the Core database into the new Security database:

- Run the `2- Migrate membership data from core database to security database.bat` batch file.

## Remove membership objects from the core database

To permanently remove the membership objects from the Core database:

- Verify that the membership data has been correctly transferred to the Security database.
- Run the `3- drop membership objects from core database.bat` batch file to permanently remove the membership objects from the Core database.

## Update the Security connection string

To update the connection to the Security database:

- In the `connectionstrings.config` file, update the `security` connection string to point to the Security database.
- You must also update the Sitecore Identity Server connection string.