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이 언급했듯이 "convert txt to UTF-8"을 검색하여 사용 가능한 컴퓨터와 소프트웨어에 맞게 작동하는 지침을 찾을 수 있습니다.

좋아요, 작동했습니다. 하지만 이제 이 오류가 나요:

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 버전은 무엇입니까?

Vanilla Higher Logic가 현재 버전입니다. 최근에 이 버전으로 업그레이드했습니다. v2.6 Vanilla 포럼의 백업이 있습니다. 기존 데이터베이스에서 가져오기를 시도했지만 여전히 동일한 문제가 발생합니다.

관리자(Admin)의 UserRole 항목을 확인해 주실 수 있나요?

@ddeveloper, 답은 16이라고 생각하지만, 정확히 무엇을 묻고 계신지 잘 모르겠습니다!
표 구조를 확인하는 데 도움이 될 수 있도록 내 내보내기 파일에서 가져온 샘플 데이터를 아래에 추가했습니다.

Export data

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","Guests can only view content. Anyone browsing the site who is not signed in is considered to be a \"Guest\".","2","0","0","0"
"3","Unconfirmed","Users must confirm their emails before becoming full members. They get assigned to this role.","3","0","1","0"
"4","Applicant","Users who have applied for membership\, but have not yet been accepted. They have the same permissions as guests.","4","0","1","0"
"8","Member","Members can participate in discussions.","5","1","1","0"
"16","Administrator","Administrators have permission to do anything.","7","1","1","0"
"32","Moderator","Moderators have permission to edit most content.","6","1","1","0"
"33","Ambassador","Former Ambassador in the original Community","1","1","1","0"

User 테이블의 경우, System 항목과 저의 정보만 나열되어 있습니다. (일부 정보는 비공개 처리되었지만, 표 구조를 파악하는 데는 도움이 될 것입니다.)

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

내가 발견한 유일한 차이는 "대소문자"였습니다. vanilla.rb 스크립트는 역할 이름에서 소문자를 허용하지 않습니다.
알 수 없는 이유로 내 내보내기 파일에는 역할 이름에 소문자가 포함되어 있었습니다.
이제 이 오류는 수정되었지만, 완전히 마이그레이션하기 전에 처리해야 할 다른 오류들도 많습니다 :smiley:

이제 날짜 형식을 수정해야 합니다:

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

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