# \[Site Down :(\] Upgrade\\Rebuild Failure - DB Migration Issue?

**URL:** <https://meta.discourse.org/t/site-down-upgrade-rebuild-failure-db-migration-issue/268359>\
**Category:** Self-hosting\
**Created:** [June 14, 2023, 8:49pm UTC](https://meta.discourse.org/t/site-down-upgrade-rebuild-failure-db-migration-issue/268359 "2023-06-14T20:49:04Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Simon\_Manning](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon_manning/32/198596_2.png) [@Simon\_Manning](https://meta.discourse.org/u/Simon_Manning)\
**Post date:** [June 15, 2023, 10:23am UTC](https://meta.discourse.org/t/site-down-upgrade-rebuild-failure-db-migration-issue/268359/8 "2023-06-15T10:23:07Z")

</div>

Expanding on what @Canapin has said, in case you haven’t already figured it out, it should be straightforward to get the usernames unique since you’ve already established that `racerx` is the only duplicated username.

First, if you haven’t already, make sure `racerx2` doesn’t already exist so you aren’t just moving the problem to a different username: (If you get an id, try a different username.)

```sql
SELECT id FROM users WHERE username_lower = 'racerx2';

```

Once you have an unused username, get the IDs of the duplicate `racerx` accounts:

```sql
SELECT id from users WHERE username_lower = 'racerx';

```

Pick one, doesn’t matter which though I would use the highest, then change its username: (Substituting `racerx2` for a different username if needed and `12345` with the `racerx` ID you picked.)

```sql
UPDATE users SET username_lower = 'racerx2' WHERE id = 12345;

```

---

_[View the full topic](https://meta.discourse.org/t/site-down-upgrade-rebuild-failure-db-migration-issue/268359)._
