将 Ning 论坛迁移至 Discourse

想要从 Ning 迁移到 Discourse?太好了!让我们开始吧。

可以导入哪些数据?

  • 用户
    • 头像
  • 目录/分类
  • 主题与帖子
    • 图片
  • 附件

前提条件

  1. macOSUbuntu 或 DebianWindows 上设置 Discourse 开发环境。

  2. 清除本地 Discourse 实例中的现有数据:

    cd ~/discourse
    rake db:drop db:create db:migrate
    
  3. 在您喜欢的编辑器中打开 Ning 导入脚本

  4. JSON_FILES_DIR 的值替换为您的 Ning 导出数据所在位置。

  5. 根据您要导入的目录/分类,在 ATTACHMENT_PREFIXES 中添加或删除值。

执行导入

  1. 根据您要导入的目录/分类,添加或删除 import_{entity} 方法。

    例如,请注意 import_photos 方法会通过读取 ning-photos-local.json 文件,导入 /ning/export/location/photos 目录中的所有图片。

    始终使用 {xyz}-local.json 文件来导入数据。

  2. 启动导入过程:

    cd ~/discourse
    bundle exec ruby script/import_scripts/ning.rb
    
  3. 等待导入完成。如果进程变得非常缓慢,您可以重新启动该过程。

  4. 启动您的 Discourse 实例:bundle exec rails server

  5. 备份数据,并按照 本指南 将其上传到您的生产站点。


恭喜!您已成功将网站从 Ning 迁移到 Discourse!:tada:

10 个赞

This guide looks very useful for people who’ve used Vagrant to get Discourse running in their environment, however is there possibly a chance of getting a guide on how to use the Ning import script in the Docker environment? If I follow this guide I get errors like “Could not locate Gemfile or ./bundle directory” and rake also doesn’t seem to be installed.

Will the ning.rb script even work in the Docker Discourse setup?

你好 @techAPJ,我在回复一篇非常旧的帖子。您还在网络世界中吗?

我们计划将 Ning 的内容迁移到 Discourse。目前我们使用的是 Discourse 托管计划。请问这种迁移仍然可行吗?还是说我们需要独立托管 Discourse?

我并非开发人员,打算外包这项迁移工作。请问有什么推荐的资源可以提供帮助吗?谢谢!

你好,Eric,

当然可以,迁移是可行的。

我看到你刚刚就迁移事宜给我们团队发了邮件。我们的社区团队有人会尽快在那里回复你。:slight_smile:

3 个赞

我想和移民团队谈谈……