---
updatedAt: 2026-04-16T20:28:49.000Z
agentTools:
  projectIndex: https://snipe-it.readme.io/llms.txt
---

# Merging Users

While you shouldn't have to do it often, there are times when you might have duplicate users and you need to merge them together. This *usually* happens when someone did a CSV import of users (or manually entered them) using a username like `jane.smith`, but then later did an LDAP sync where the username in LDAP was `jane.smith@example.org`. (Most cloud-hosted LDAP providers expect an email address as the username.)

The challenge comes in where you want to *keep* the existing associations (checkouts, checkins, etc) for `jane.smith` but you need to switch over to the LDAP convention so that you don't keep ending up with duplicated users on LDAP sync. This is made even more complicated when you have checkouts/checkins/etc to *both* `jane.smith` and `jane.smith@example.org` and you need to merge those two sets of records into one.

Snipe-IT provides a command-line utility to do this:

## What it does

This command allows you to merge the history of users. It looks for users *without* an email address as their username and merges them into the version that *does* have an email username. It will then mark the non-email username as deleted. As always, we recommend doing a backup before running any data-altering scripts.

You can [view the code in the Github repo here](https://github.com/snipe/snipe-it/blob/master/app/Console/Commands/MergeUsersByUsername.php).

> 🚧 **Note that this will (currently) ONLY merge non-email usernames into email usernames, NOT the other way around.**

## Running the command

To run this command, you should be in the main directory of your Snipe-IT installation.

```
# Merge users without an email address username into the email address username version          	
$ php artisan snipeit:merge-users
```

If you only have a few, you can manually merge users via the GUI as well.