我需要一些关于从 NodeBB 迁移到 Discourse 的指导。我看到了这个帖子,发现是 @eatcodetravel 创建了该脚本。我不太明白这些脚本是如何执行的。我是否需要在运行 Discourse 的服务器上同样安装 Redis 以进行导入?
感谢您的帮助。
我需要一些关于从 NodeBB 迁移到 Discourse 的指导。我看到了这个帖子,发现是 @eatcodetravel 创建了该脚本。我不太明白这些脚本是如何执行的。我是否需要在运行 Discourse 的服务器上同样安装 Redis 以进行导入?
感谢您的帮助。
Hey @michael,
You need redis to run discourse. The nodebb importer is only available if you use redis as your nodebb database. Here is how I would do the migration.
The importer will connect to your nodebb redis database and copy everything over discourse, the time it takes is related to the amount of data you have. Also, you need to wait for discourse to finish processing jobs before you do the backup, go to /sidekiq route as an admin and you will see the pending/completed jobs
Hope it helps
谢谢!
我通过 Digital Ocean + Docker 运行 Discourse。我在容器内编辑了 script/import_scripts/nodebb/nodebb.rb,并将 ATTACHMENT_DIR 修改为包含我存放 nodebb 的目录。我也将 nodebb 目录放入了容器内。
那么 Redis 转储文件呢?
Oh I see there’s no comment in the redis connection parameters, I’ll open a PR for that
Here’s where you put the connection parameters for nodebb redis discourse/script/import_scripts/nodebb/nodebb.rb at main · discourse/discourse · GitHub
Here are the quick steps I took when I first ran the importer when it was under development. I can also attest to it working wonderfully.
bundle exec ruby script/import_scripts/nodebb/nodebb.rb
I do recommend taking a look at Preparing for and undertaking a platform migration, it has some great steps for validation and planning a migration.
感谢 @eatcodetravel 和 @tehspaceg
运行 exec ruby script/import_scripts/nodebb/nodebb.rb 后,我收到以下信息:
无法连接到数据库,无法检索站点设置!(在运行 db:create 时这是正常的)
我将 dump.rdb 从 NodeBB 服务器移动到了我的 Discourse Docker 容器的 /shared/redis_data 目录中。
有什么建议吗?![]()
我随意猜测一下。我认为它没有导入 Redis 转储文件。
我卡住了。我是 Redis 新手,虽然学到了很多,但就是无法理解这最后一块拼图。
I neglected to write down the actual paths to files, I just had those notes from when I did it.
Are you using a dev environment outside of the Docker image? it might make it easier ensure redis is stopped when you replace the dump.rdb file.
Edit: I wrote this before finishing coffee. So the reason I suggest that you need to have redis stopped is that I don’t think it will read from the dump file until after it has been stopped (redis stores the database in memory and periodically writes to the dump.rdb file)
我试图停止 Redis,但它似乎无论我做什么都在继续运行。我已经杀死了十几次进程,但它仍然在运行。:困惑:
我再次尝试解决这个问题。同样的错误仍然出现,并包含以下内容:
\u003e FATAL: 用户 “discourse” 的对等认证失败 (PG::ConnectionBad)
我是否应该在 Docker 容器内运行此操作?我一直以 root 身份这样做。我也尝试过以 discourse 身份运行,结果如下:
\u003e FATAL: 数据库 “discourse_development” 不存在 (ActiveRecord::NoDatabaseError)
不确定我哪里做错了。
No, as per instructions you should:
就是这样。我之前不知道 Docker 完全不能用。