> ## Documentation Index
> Fetch the complete documentation index at: https://docs.databunker.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate an existing project

> Two ways to move user personal data out of your database and into Databunker.

To use Databunker in an existing project, move personal records out of your own tables and into Databunker. Your application then finds a user by their Databunker token, email, login name, phone number or custom index.

## Example schema

In this schema the personal data sits in the `users` table, and other tables reference it by `userid`. After the migration, that personal data lives in Databunker.

![Original database schema](https://mintcdn.com/databunker-a1572a73/Xt_tLUEqXpO4A3NI/oss/get-started/db-original.png?fit=max\&auto=format\&n=Xt_tLUEqXpO4A3NI\&q=85\&s=c4ede1e51c167262df6f0fa4a707b181)

## Method 1: keep `userid`, add a token

Change only the `users` table. Remove every personal-data column, keep the original `userid` (or `id`) column, and add a `usertoken` column that holds the UUID token Databunker returns when you create the user.

![Users table with personal data replaced by a usertoken column](https://mintcdn.com/databunker-a1572a73/Xt_tLUEqXpO4A3NI/oss/get-started/db-simple.png?fit=max\&auto=format\&n=Xt_tLUEqXpO4A3NI\&q=85\&s=d3abd6117bec0fc5939e65b3368519d0)

This is the right choice for a large database, or when `userid` is referenced by many tables, because nothing outside `users` changes.

The trade-off: each user now has two identifiers, `userid` and `usertoken`.

## Method 2: replace `userid` everywhere

Change every table that references `userid` to reference `usertoken` instead, so the Databunker token becomes the only user identifier.

![All tables referencing usertoken instead of userid](https://mintcdn.com/databunker-a1572a73/Xt_tLUEqXpO4A3NI/oss/get-started/db-complex.png?fit=max\&auto=format\&n=Xt_tLUEqXpO4A3NI\&q=85\&s=fbe01798399c3d7fa7e567c7b96e77f9)

This leaves one identifier per user, but requires more changes to the schema and to application code.

## Next steps

* [Quickstart](https://docs.databunker.org/oss/get-started/quickstart.md)
* [Installation guide](https://docs.databunker.org/oss/installation/overview.md)
* [Databunker Pro: migrate a SQL users table](https://docs.databunker.org/pro/migrations/sql-users-table.md), a step-by-step version of the same pattern


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.