# 从 discourse v2.8.13 (在 Ubuntu 20.04.6 LTS 上) 迁移到最新版本

**URL:** https://meta.discourse.org/t/migration-from-discourse-v2-8-13-on-ubuntu-20-04-6-lts-to-latest/275217
**Category:** Self-hosting
**Created:** [2023 年8 月 15 日 11:40 UTC](https://meta.discourse.org/t/migration-from-discourse-v2-8-13-on-ubuntu-20-04-6-lts-to-latest/275217 "2023-08-15T11:40:34Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2023 年8 月 15 日 13:13 UTC](https://meta.discourse.org/t/migration-from-discourse-v2-8-13-on-ubuntu-20-04-6-lts-to-latest/275217/4 "2023-08-15T13:13:01Z")

</div>

> [@CamilleRoux](#):
>
> ```plaintext
> 迁移默认值失败
> #<StandardError: "发生错误，所有后续迁移均已取消：
> 
> PG::UniqueViolation: 错误：重复键值违反唯一约束“index_users_on_username_lower”
> 详细信息：键 (username_lower)=(philippe) 已存在。
> ">
> 
> ```

> 键 (username\_lower)=(philippe) 已存在。

⚠ 在尝试修复任何问题之前，请进行完整备份，因为您可能会使其更加损坏。

有几个主题提供了有关如何处理重复错误的指导（您基本上必须找到并删除重复项，然后才能继续）

> [@2.7.0.beta2 upgrade failed with ERROR: duplicate key](https://meta.discourse.org/t/2-7-0-beta2-upgrade-failed-with-error-duplicate-key/176980):
>
> I was upgrading from 2.7.0.beta1 and got this error message: 2021-01-22 20:16:22.015 UTC [4055] discourse@discourse LOG: duration: 75335.241 ms statement: UPDATE notifications SET processed = true 2021-01-22 20:16:23.792 UTC [4055] discourse@discourse LOG: duration: 1776.591 ms statement: ALTER TABLE "notifications" ALTER COLUMN "processed" SET NOT NULL 2021-01-22 20:16:25.198 UTC [4055] discourse@discourse LOG: duration: 1323.298 ms statement: CREATE INDEX "index\_notifications\_on\_proce…

> [@Corrupt indexes in PG12, how do I fix?](https://meta.discourse.org/t/corrupt-indexes-in-pg12-how-do-i-fix/152570):
>
> Sorry for bumping this once again, I got a very strange discourse=# REINDEX SCHEMA CONCURRENTLY public; ERROR: could not create unique index "index\_tags\_on\_name\_ccnew" DETAIL: Key (name)=(chronicillness) is duplicated. I’m assuming it can be fixed by the solution suggested above by @riking but I’m unable to figure out how to modify the syntax to suit my case. frowning

> [@Problem in upgrade: duplicate key value violates unique constraint](https://meta.discourse.org/t/problem-in-upgrade-duplicate-key-value-violates-unique-constraint/256826):
>
> Hello, I just used the upgrade tool to upgrade my discourse instance. Oddly, the forum is now down. When I tried to rebuild using the command line, I am getting this error: duplicate key value violates unique constraint "index\_tags\_on\_lower\_name" This error is repeated multiple times in the log so I recon its something about it. Here is the full logs: [https://paste.apps.7ho.st/dezomakasu.sql](https://paste.apps.7ho.st/dezomakasu.sql) (This is a portion of the logs, but [here is](https://paste.apps.7ho.st/sadoqetohu.yaml) the full log) Could anyone help me out? I also restored…

---

_[View the full topic](https://meta.discourse.org/t/migration-from-discourse-v2-8-13-on-ubuntu-20-04-6-lts-to-latest/275217)._
