Error importing from vanilla: invalid byte sequence in UTF-8

ファイルが巨大でない限り、まだWindowsのメモ帳があれば、UTF-8に変換するのは非常に簡単です。

Vanilla Porterは.txt.gz形式のファイルを提供すると思われます。その圧縮形式からファイルを抽出する必要があります。.txtファイルとして保存したら、変換できます。

  1. .txtファイルをメモ帳で開きます。
  2. 「ファイル」>「名前を付けて保存」に移動し、エンコーディングオプションとしてUTF-8を選択します。
  3. 「保存」をクリックします。

まだメモ帳がない場合、またはファイルがメモ帳には大きすぎる場合は、@pfaffmanが言及したように、「txtをUTF-8に変換」とGoogleで検索すると、利用可能なマシンやソフトウェアで機能する手順が見つかるはずです。

「いいね!」 4

わかりました。これは機能しました。しかし、今はこのエラーが発生しています。

script/import_scripts/vanilla.rb:98:in `import_users': undefined method `[]' for nil:NilClass (NoMethodError)

admin_role_id = @roles.select { |r| r[:name] == "Administrator" }.first[:role_id]
                                                                       ^^^^^^^^^^

最初のユーザーはデータベースの管理者です。

これは、ソースフォーラムタイプのドロップダウンから Vanilla 2 を選択する必要があることに気づく前に、まさに私が受け取っていたエラーです。Vanilla 1 を選択したままにすると、エクスポートファイルには空のデータテーブルが含まれていました。Vanilla 2 を選択した場合、Vanilla の移行に関する私の限られた経験から提供できるものはあまりありません。他の誰かが何かアイデアを持っているかもしれません。

現在のフォーラムはどのバージョンの Vanilla を実行していますか?

「いいね!」 5

Vanilla Higher Logic が現在のバージョンです。最近このバージョンにアップグレードしました。v2.6 Vanilla フォーラムのバックアップがあります。古いデータベースからインポートしようとしましたが、問題は同じです。

Admin の UserRole エントリを確認していただけますか?

@ddeveloper、答えは「16」だと思いますが、何をお尋ねか確信がありません!
参考になるかもしれないので、エクスポートファイルからサンプルデータを以下に追加しました。

エクスポートデータ

これは、UserRoleテーブルのエクスポートファイルに記載されている「System」ユーザーと私(ユーザー2)のものです。

Table: UserRole
UserID:int,RoleID:int
"1","16"
"2","2"
"2","8"
"2","16"
"2","32"
"2","33"

これは、Roleテーブルのエクスポートファイルに記載されているものです。
Table: Role

RoleID:int,Name:varchar(100),Description:varchar(500),Sort:int,Deletable:tinyint,CanSession:tinyint,PersonalInfo:tinyint
"2","Guest","ゲストはコンテンツのみ表示できます。サインインしていないサイト閲覧者は「ゲスト」とみなされます。","2","0","0","0"
"3","Unconfirmed","ユーザーはフルメンバーになる前にメールを確認する必要があります。このロールが割り当てられます。","3","0","1","0"
"4","Applicant","メンバーシップを申請したが、まだ承認されていないユーザー。ゲストと同じ権限を持ちます。","4","0","1","0"
"8","Member","メンバーはディスカッションに参加できます。","5","1","1","0"
"16","Administrator","管理者はあらゆることを行う権限を持ちます。","7","1","1","0"
"32","Moderator","モデレーターはほとんどのコンテンツを編集する権限を持ちます。","6","1","1","0"
"33","Ambassador","元のコミュニティの元アンバサダー","1","1","1","0"

これは、Userテーブルに記載されているものです。システムエントリと私のみです。(一部の情報は編集されていますが、テーブル構造のアイデアは得られるはずです。)

Table: User
UserID:int,Name:varchar(50),Password:varbinary(100),HashMethod:varchar(10),Photo:varchar(255),Title:varchar(100),Location:varchar(100),About:text,Email:varchar(200),ShowEmail:tinyint,CountVisits:int,CountInvitations:int,CountNotifications:int,InviteUserID:int,DiscoveryText:text,Preferences:text,Permissions:text,Attributes:text,DateSetInvitations:datetime,DateOfBirth:datetime,DateFirstVisit:datetime,DateLastActive:datetime,LastIPAddress:varchar(15),DateInserted:datetime,InsertIPAddress:varchar(15),DateUpdated:datetime,UpdateIPAddress:varchar(15),HourOffset:int,Score:float,Admin:tinyint,Confirmed:tinyint,Verified:tinyint,Banned:tinyint,Deleted:tinyint,Points:int,CountUnreadConversations:int,CountDiscussions:int,CountUnreadDiscussions:int,CountComments:int,CountDrafts:int,CountBookmarks:int
"1","System","XXX","Random","https://XXX.com/applications/dashboard/design/images/usericon.png",\N,\N,\N,"system@stub.vanillacommunity.example","0","0","0","4",\N,\N,\N,"",\N,\N,\N,\N,\N,\N,"2022-11-18 03:39:35",\N,\N,\N,"0",\N,"2","1","0","0","0","0",\N,"1",\N,\N,\N,\N
"2","southpaw","XXX","Vanilla","userpics/QOZBY6BY3J3T/O8C563H2DWZV.jpg",\N,\N,\N,"XXX@gmail.com","0","258","0","24",\N,\N,"{\"DashboardNav.DashboardLandingPage\":\"Settings\"\, \"DashboardNav.SectionLandingPages\":{\"Settings\":\"/dashboard/settings/layout\"\, \"Moderation\":\"/dashboard/user\"}\,, \"DashboardNav.Collapsed\":[]\, \"Popup.WallComment\":\"1\"\, \"Popup.ActivityComment\":\"1\"\, \"Email.AnswerAccepted\":\"1\"\, \"Popup.AnswerAccepted\":\"1\"\, \"Email.QuestionAnswered\":\"1\"\, \"Popup.QuestionAnswered\":\"1\"\, \"Email.ConversationMessage\":\"1\"\, \"Popup.ConversationMessage\":\"1\"\, \"Email.BookmarkComment\":\"1\"\, \"Email.Mention\":\"1\"\, \"Email.ParticipateComment\":\"1\"\, \"Popup.DiscussionComment\":\"1\"\, \"Popup.BookmarkComment\":\"1\"\, \"Popup.Mention\":\"1\"\, \"Popup.ParticipateComment\":\"1\"}",\"{\"0\":\"Garden.Email.View\"\, \"1\":\"Garden.Settings.Manage\"\, \"2\":\"Garden.Settings.View\"\, \"3\":\"Garden.SignIn.Allow\"\, \"4\":\"Garden.Users.Add\"\, \"5\":\"Garden.Users.Edit\"\, \"6\":\"Garden.Users.Delete\"\, \"7\":\"Garden.Users.Approve\"\, \"8\":\"Garden.Activity.Delete\"\, \"9\":\"Garden.Activity.View\"\, \"10\":\"Garden.Profiles.View\"\, \"11\":\"Garden.Profiles.Edit\"\, \"12\":\"Garden.Curation.Manage\"\, \"13\":\"Garden.Moderation.Manage\"\, \"14\":\"Garden.PersonalInfo.View\"\, \"15\":\"Garden.AdvancedNotifications.Allow\"\, \"16\":\"Garden.Community.Manage\"\, \"17\":\"Garden.Uploads.Add\"\, \"18\":\"Vanilla.Tagging.Add\"\, \"19\":\"Conversations.Conversations.Add\"\, \"20\":\"Plugins.Attachments.Upload.Allow\"\, \"21\":\"Reactions.Positive.Add\"\, \"22\":\"Reactions.Negative.Add\"\, \"23\":\"Reactions.Flag.Add\"\, \"24\":\"Vanilla.Discussions.View\"\, \"25\":\"Vanilla.Discussions.Add\"\, \"26\":\"Vanilla.Discussions.Edit\"\, \"27\":\"Vanilla.Discussions.Announce\"\, \"28\":\"Vanilla.Discussions.Sink\"\, \"29\":\"Vanilla.Discussions.Close\"\, \"30\":\"Vanilla.Discussions.Delete\"\, \"31\":\"Vanilla.Comments.Add\"\, \"32\":\"Vanilla.Comments.Edit\"\, \"33\":\"Vanilla.Comments.Delete\"\, \"Vanilla.Discussions.View\":[1\,2\,3\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Discussions.Add\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Discussions.Edit\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Discussions.Announce\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Discussions.Sink\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Discussions.Close\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Discussions.Delete\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Comments.Add\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Comments.Edit\":[1\,2\,4\,5\,6\,7\,8\,9]\, \"Vanilla.Comments.Delete\":[1\,2\,4\,5\,6\,7\,8\,9]}\",\"{\"TimeZone\":\"America/New_York\"\, \"LastLoginAttempt\":1687373198\, \"LoginRate\":1\, \"CheckedComments\":[]\, \"floodcontrol.profilecontroller.2.currentpostcount\":1\, \"\": \"2022-12-04 02:28:17\"\, \"CheckedDiscussions\":[]}\",\N,"1975-09-16 00:00:00","2022-11-18 03:39:35","2023-07-17 01:06:51","A¾’²","2022-11-18 03:39:35","A¾’²","2023-07-11 03:36:17","A¾’²","-4",\N,"1","1","1","0","0","182","3","14",\N,"83","0",\N
「いいね!」 3

見つけた唯一の違いは「大文字と小文字」でした。vanilla.rb スクリプトは、ロール名で小文字を受け付けません。
何らかの理由で、私のエクスポートファイルにはロール名に小文字が含まれていました。
これでこのエラーは修正されましたが、完全に移行する前に対処しなければならない他のエラーもたくさんあります :smiley:

次に、日付のフォーマットを修正する必要があります。

script/import_scripts/vanilla.rb:281:in `strptime': invalid date (Date::Error)

    DateTime.strptime(date, "%Y-%m-%d %H:%M:%S")

「いいね!」 2