この投稿で攻撃されたと感じた方がいたら、まず謝罪させてください。正直なところ、月曜日からこれらの問題に取り組んでおり、これ以上Discourseのコードのデバッグやホットフィックスを行う気力はありません。
7回数えた後、7回目の試行で諦めることにしました。なぜなら、Discourseは移行をあまりサポートしていないように見えるからです。
最大の СHARSET 問題は、この巨大なデータベースで使用されている СHARSET が utf8mb4 であり、スクリプトがサポートしていないことだと考えています。
utf8(デフォルト)を使用すると、多くのエラーが報告されますが、スクリプトはそのまま続行するため、何が起こっているのか不明です。データベースのエントリはスキップされていますか?サポートされていない文字(古典的な四角形)でコピーされていますか?
さらに、最新の3回の実行(バルクインポータを使用)では、まったく同じ指示に従ったにもかかわらず、結果が異なります。最後の実行では、トピックのインポートに到達し、すぐにエラーを報告し始めましたが、続行しました(???):
アプリケーションをロード中...
開始中...
I18n をプリロード中...
最高の投稿番号を修正中...
インポートされたグループID をロード中...
インポートされたユーザーID をロード中...
インポートされたカテゴリID をロード中...
インポートされたトピックID をロード中...
インポートされた投稿ID をロード中...
グループインデックスをロード中...
ユーザーインデックスをロード中...
カテゴリインデックスをロード中...
トピックインデックスをロード中...
投稿インデックスをロード中...
投稿アクションインデックスをロード中...
カテゴリをインポート中...
親カテゴリをインポート中...
5 - 1104/sec
子カテゴリをインポート中...
500 - 1539/secエラー: 一意制約違反の重複キー値 \"unique_index_categories_on_name\"
詳細: キー (COALESCE(parent_category_id, '-1'::integer), name)=(-1, Armata Brancaleone) は既に存在します。
コンテキスト: COPY categories, line 69
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.4.5/lib/pg/connection.rb:204:in `get_last_result'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.4.5/lib/pg/connection.rb:204:in `copy_data'
/var/www/discourse/script/bulk_import/base.rb:720:in `create_records'
/var/www/discourse/script/bulk_import/base.rb:361:in `create_categories'
script/bulk_import/vbulletin5.rb:291:in `import_categories'
script/bulk_import/vbulletin5.rb:69:in `execute'
/var/www/discourse/script/bulk_import/base.rb:98:in `run'
script/bulk_import/vbulletin5.rb:779:in `<main>'
トピックをインポート中...
600 - 4073/sec
エラー: 未定義のメソッド `[]' for nil:NilClass
/var/www/discourse/script/bulk_import/base.rb:513:in `process_topic'
/var/www/discourse/script/bulk_import/base.rb:724:in `block (2 levels) in create_records'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/mysql2/alias_method.rb:8:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/mysql2/alias_method.rb:8:in `each'
/var/www/discourse/script/bulk_import/base.rb:721:in `block in create_records'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.4.5/lib/pg/connection.rb:196:in `copy_data'
/var/www/discourse/script/bulk_import/base.rb:720:in `create_records'
/var/www/discourse/script/bulk_import/base.rb:364:in `create_topics'
script/bulk_import/vbulletin5.rb:321:in `import_topics'
script/bulk_import/vbulletin5.rb:70:in `execute'
/var/www/discourse/script/bulk_import/base.rb:98:in `run'
script/bulk_import/vbulletin5.rb:779:in `<main>'
最終的にこれにクラッシュしました:
script/bulk_import/vbulletin5.rb:779:in `<main>'
572329 - 531/sec
返信をインポート中...
client_loop: send disconnect: Connection reset
しかし、それ以前に、これら2つのエラーを絶えずスパムしていました:
エラー: 未定義のメソッド `gsub!' for nil:NilClass
script/bulk_import/vbulletin5.rb:727:in `preprocess_raw'
script/bulk_import/vbulletin5.rb:369:in `block in import_topic_first_posts'
/var/www/discourse/script/bulk_import/base.rb:723:in `block (2 levels) in create_records'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/mysql2/alias_method.rb:8:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/mysql2/alias_method.rb:8:in `each'
/var/www/discourse/script/bulk_import/base.rb:721:in `block in create_records'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.4.5/lib/pg/connection.rb:196:in `copy_data'
/var/www/discourse/script/bulk_import/base.rb:720:in `create_records'
/var/www/discourse/script/bulk_import/base.rb:367:in `create_posts'
script/bulk_import/vbulletin5.rb:361:in `import_topic_first_posts'
script/bulk_import/vbulletin5.rb:71:in `execute'
/var/www/discourse/script/bulk_import/base.rb:98:in `run'
script/bulk_import/vbulletin5.rb:779:in `<main>'
および
エラー: 無効なバイトシーケンス UTF-8
script/bulk_import/vbulletin5.rb:727:in `gsub!'
script/bulk_import/vbulletin5.rb:727:in `preprocess_raw'
script/bulk_import/vbulletin5.rb:369:in `block in import_topic_first_posts'
/var/www/discourse/script/bulk_import/base.rb:723:in `block (2 levels) in create_records'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/mysql2/alias_method.rb:8:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/mysql2/alias_method.rb:8:in `each'
/var/www/discourse/script/bulk_import/base.rb:721:in `block in create_records'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/pg-1.4.5/lib/pg/connection.rb:196:in `copy_data'
/var/www/discourse/script/bulk_import/base.rb:720:in `create_records'
/var/www/discourse/script/bulk_import/base.rb:367:in `create_posts'
script/bulk_import/vbulletin5.rb:361:in `import_topic_first_posts'
script/bulk_import/vbulletin5.rb:71:in `execute'
/var/www/discourse/script/bulk_import/base.rb:98:in `run'
script/bulk_import/vbulletin5.rb:779:in `<main>'
ステップバイステップで、実行する関数をコメントアウトし、rake import:ensure_consistency を実行してから、実行した関数をコメントアウトして続行しました。なぜなら、スクリプト全体を実行すると、以前実行したステップを再度実行してしまい、重複したIDが見つかってクラッシュするからです。
通常の「フリーソフトウェアなので文句は言えない」という議論が出る前に、他のオープンソースプロジェクトにも貢献しており、同様に無料でソフトウェアを作成していることを明確にしておきたいです。しかし、リリースしたものは機能し、十分に文書化されていることが私にとって非常に重要です(たとえ、それが「これはどのように機能するのか」という何千ものメッセージを回避するためだけでも)または、発生したバグを修正する準備ができています。
Discourseは優れたすぐに使えるエクスペリエンスを提供しているように見えますが、2022年であり、コミュニティはこの製品よりもずっと前から存在していたことは明確にしておくべきです。「採用」には強力な移行サポートが必要であり、Discourseの現在の状態ではないようです。
20GBのデータベースはエッジケースであると認識していますが、ここではサイズの問題ではなく、СHARSET またはその他の何らかの問題が発生しています。というのも、一貫したエラーがなく、ほとんどの場合、ドキュメントはなく、過去に同じ苦境を経験した人々が残したスレッドや投稿を検索し、回避策が見つかったことを願い、ソースコードがそれ以来あまり変更されていないことを期待するだけです。
現時点では、vbulletinからの移行を検討しているすべての人に、移行スクリプトのオーバーホール(進行中であるように見えますか?)が完了するまで、移行を保留することを強くお勧めします。