# 将 XenForo 论坛迁移到 Discourse

**URL:** https://meta.discourse.org/t/migrate-a-xenforo-forum-to-discourse/45232
**Category:** Sysadmins
**Tags:** how-to
**Created:** [2016 年6 月 4 日 01:38 UTC](https://meta.discourse.org/t/migrate-a-xenforo-forum-to-discourse/45232 "2016-06-04T01:38:22Z")
**Posts on this page:** 1
**Showing post:** 121

<div class="post-metadata">

### Author: ![SubStrider](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/substrider/32/512604_2.png) [@SubStrider](https://meta.discourse.org/u/SubStrider)
#### Post date: [2025 年2 月 16 日 13:12 UTC](https://meta.discourse.org/t/migrate-a-xenforo-forum-to-discourse/45232/121 "2025-02-16T13:12:14Z")

</div>

好的，我已经进入下一步。上面有人发帖说我们需要在容器的 /var/www/discourse 文件夹中，然后添加 gem。

现在是最后一步

```plaintext
RAILS_ENV=production bundle exec ruby script/import_scripts/xenforo.rb

```

我收到了这个错误。我可能做错了什么？

`/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:63:in "rescue in new_client": We could not find your database: discourse. Available database configurations can be found in config/database.yml. (ActiveRecord::NoDatabaseError)To resolve this error:- Did you not create the database, or did you delete it? To create the database, run: bin/rails db:create- Has the database name changed? Verify that config/database.yml contains the correct database name.`

**已解决：我之前是以 root 用户运行的，必须切换到 ‘discourse’ 用户。导入已开始。**

---

_[View the full topic](https://meta.discourse.org/t/migrate-a-xenforo-forum-to-discourse/45232)._
