No budget for this. But. Maybe.
Anyone seen this problem when running the import script?
Postprocessing posts…
37785 / 48843 ( 77.4%) Killed*
The process was killed before completing. When I load the Forums, the imported messages seem to be there, bit I am worried it didn’t gracefully complete and there will be problems.
Any recommendations? Perhaps an out of memory error? Can I simply re-run the script to pick up where it left off or will it try to re-import duplicate data? Thank you.
Rerun the script. It will not duplicate data.
Thank you, @pfaffman! This worked great.
Hi,
First off thank you for this fantastic guide. I appreciate the work that’s been put into this.
For my issue
I’m having trouble with connecting to the database when I run the import script, albeit I’m using Mariadb to house the vbulletin dump rather than mysql. I’ve verified that MariaDB is running, I’m able to import my vbulletin dump into it, and I’ve quadruple checked the username, hostname, and password in the script but still no luck.
I feel as though I’m missing something simple, if someone could point me in the right direction that’d be very helpful
I’m using the following versions
mysql2 0.5.2
mariadb-server-10.3
dicourse master git commit cb8fa46
Full description below
When I try and run
apt-get update && apt-get install libmysqlclient-dev mysql-server-5.7
I get an error
E: Package 'libmysqlclient-dev' has no installation candidate
E: Package 'mysql-server-5.7' has no installation candidate
which makes sense, perhaps those packages have been removed from the repository in this time.
So instead I run
apt-get update && apt-get install mariadb-server-10.3 libmariadbd-dev
Mariadb works as a drop in replacement which is nice because all steps work up until I try to run the migration script at which point I get the error
root@discourse:/src# su discourse -c 'bundle exec ruby script/import_scripts/vbulletin.rb'
root:@localhost wants vb4
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
==================================================
Access denied for user 'root'@'localhost'
Cannot connect in to database.
Hostname: localhost
Username: root
Password:
database: vb4
Edit the script or set these environment variables:
export DB_HOST="localhost"
export DB_NAME="vbulletin"
export DB_PW=""
export DB_USER="root"
export TABLE_PREFIX="vb_"
export ATTACHMENT_DIR '/path/to/your/attachment/folder'
Exiting.
For permissions
root@discourse:/src# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 59
Server version: 10.3.17-MariaDB-0+deb10u1 Debian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show grants;
+------------------------------------------------------------------------------------------------+
| Grants for root@localhost |
+------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION |
| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION |
+------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)
I have double checked the username and password many times, and even manually set it myself.
조금 더 조사해 보니, 기본 이미지 변경으로 인해 mysql이 더 이상 사용 불가능해진 원인은 Ubuntu 16.04에서 debian으로 바뀐 것이 분명하지만, mysql2가 MariaDB에 연결하는 방법은 여전히 알 수 없습니다.
얼굴 전에 mysql-dep.template.yml를 MariaDB로 사용하도록 변경하는 PR을 제출한 적이 있습니다. 몇 번 사용해 봤습니다.
비밀번호를 사용하지 않으려는 것 같습니다. 비밀번호 사용을 권장합니다. 스크립트는 비밀번호가 있다고 가정하고 작성되어 있습니다.
알겠습니다. 비밀번호를 설정해서 작동하는지 확인해 보겠습니다. 다만 제 생각에는 MariaDB에서도 가져오기 스크립트가 여전히 작동해야 할 것 같습니다. 그렇다면 계속 문제를 해결해 보겠습니다. 빠른 도움 주셔서 감사합니다!
@pfaffman 그게 맞았어요! 정말 감사합니다. 포럼을 정리하는 대로 VB3 버전에 대한 PR을 보내도 좋을 것 같으니, 혹시 유용한 분이 계실지 모르겠네요.
이건 제 테스트 인스턴스이기도 해서 세부 정보를 게시해도 괜찮고, 곧 삭제될 예정이니까요 ![]()
모두의 도움에 감사드립니다. 마이그레이션은 대체로 잘 진행되었습니다. 여기저기 누락된 첨부 파일이 몇 개 있었지만, 전반적으로는 매우 성공적이었습니다.
미래에 이 글을 읽을 분들을 위해, 저는 Vb3.8.7에서 마이그레이션했습니다.
vbulletin.rb의 SQL 쿼리를 몇 가지 수정해야 했는데, 제 데이터베이스 구조가 스크립트와 정확히 일치하지는 않았지만 꽤 가까웠습니다. 진행을 위해 커스텀 캡션은 포기하기로 했습니다.
GitHub diff: File fix other - Pull Request #1 - canyon289/discourse - GitHub
mysql을 대체하는 MariaDB 설치를 위해 다음 명령어를 사용했습니다.
apt-get update && apt-get install mariadb-server-10.3 libmariadbd-dev
그리고 MariaDB 비밀번호를 null에서 값으로 변경하는 데에는 다음 링크가 가장 포괄적이었습니다.
https://websiteforstudents.com/how-to-change-mysql-mariadb-user-passwords-on-ubuntu-16-04-18-04/
다시 한번 이 스레드의 모든 분들과 코드 및 도움을 제공한 discourse 기여자들에게 감사의 인사를 전합니다.
방금 마이그레이션을 완료했는데, vBulletin 4 인스턴스에서 상속된 카테고리가 2,000개 이상의 모든 주제에 부여되었습니다. 이 카테고리를 삭제하고 마이그레이션된 모든 게시물을 카테고리가 선택되지 않은 상태로 되돌리고 싶은데, "2322개의 주제가 포함되어 있어 이 카테고리를 삭제할 수 없습니다"라는 메시지가 표시됩니다.
이 문제를 우회할 수 있는 방법이 있을까요?
다시 마이그레이션을 실행하거나 해당 토픽들의 카테고리를 변경해야 합니다. 그렇게 많으면 Ruby 명령줄에서 직접 처리해야 합니다.
안녕하세요,
이 부분의 맥락이 잘 모르겠어요.
Copy the attachments to your Discourse instance (for the path check your VB4 settings).
혹시 도와주실 수 있는 분 계신가요?
안녕하세요,
vBulletin 5 스크립트가 있는 것을 확인했습니다. 하지만 이에 대한 피드백을 찾을 수 없습니다. 이 주제에 있는 정보가 vBulletin 5에도 적용되는지 궁금합니다.
감사합니다!
스크립트는 매우 유사하게 작동해야 합니다.
vB4 설치에 대한 가져오기(import)를 실행 중인데, 하위 카테고리(children categories)를 가져오는 과정에서 실패합니다. Rails/Ruby 초보자인 만큼 이해해 주십시오.
Traceback (most recent call last):
20: from script/import_scripts/vbulletin.rb:943:in `<main>'
19: from /home/vagrant/discourse/script/import_scripts/base.rb:47:in `perform'
18: from script/import_scripts/vbulletin.rb:84:in `execute'
17: from script/import_scripts/vbulletin.rb:293:in `import_categories'
16: from /home/vagrant/discourse/script/import_scripts/base.rb:403:in `create_categories'
15: from /home/vagrant/discourse/script/import_scripts/base.rb:403:in `each'
14: from /home/vagrant/discourse/script/import_scripts/base.rb:422:in `block in create_categories'
13: from /home/vagrant/discourse/script/import_scripts/base.rb:454:in `create_category'
12: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/suppressor.rb:48:in `save!'
11: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/transactions.rb:319:in `save!'
10: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
9: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/transactions.rb:212:in `transaction'
8: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:281:in `transaction'
7: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
6: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
5: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
4: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:281:in `block in transaction'
3: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
2: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/transactions.rb:319:in `block in save!'
1: from /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/validations.rb:53:in `save!'
/home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/validations.rb:81:in `raise_validation_error': Validation failed: Slug is invalid (ActiveRecord::RecordInvalid)
문제 해결을 위해 디버그 출력을 추가했습니다. Category의 slug 값이 nil입니다.
create_categories(children_categories) do |category| 루프를 돌 때 카테고리는 유효해 보입니다. 또한 base.rb의 def create_category에서 .save! 바로 직전에 opts, import_id, new_category도 로그로 기록하고 있습니다. 함수가 기대하는 값 기준으로 모두 유효해 보입니다.
이전에 이런 문제를 겪으신 분이 계신가요?
37 / 53 ( 69.8%) [345139 items/min]
category:
{"forumid"=>355, "title"=>"News", "description"=>"RSS Feed", "displayorder"=>6, "parentid"=>205}
Entering create_category...
opts:
{:id=>355, :name=>"News", :position=>6, :description=>"RSS Feed", :parent_category_id=>6}
import_id:
355
new_category:
#<Category id: nil, name: "News", color: "BF1E2E", topic_id: nil, topic_count: 0, created_at: nil, updated_at: nil, user_id: -1, topics_year: 0, topics_month: 0, topics_week: 0, slug: nil, description: nil, text_color: "FFF", read_restricted: false, auto_close_hours: nil, post_count: 0, latest_post_id: nil, latest_topic_id: nil, position: 6, parent_category_id: 6, posts_year: 0, posts_month: 0, posts_week: 0, email_in: nil, email_in_allow_strangers: false, topics_day: 0, posts_day: 0, allow_badges: true, name_lower: nil, auto_close_based_on_last_post: false, topic_template: nil, contains_messages: nil, sort_order: nil, sort_ascending: nil, uploaded_logo_id: nil, uploaded_background_id: nil, topic_featured_link_allowed: true, all_topics_wiki: false, show_subcategory_list: false, num_featured_topics: 3, default_view: nil, subcategory_list_style: "rows_with_featured_topics", default_top_period: "all", mailinglist_mirror: false, minimum_required_tags: 0, navigate_to_first_post_after_read: false, search_priority: 0, allow_global_tags: false, reviewable_by_group_id: nil, required_tag_group_id: nil, min_tags_from_required_group: 1>
Traceback (most recent call last):
저희 개발자가 스크립트를 시도해 보았지만 크게 진전을 이루지 못했습니다. 컨설팅 형태로 대신 진행해 주실 분이 계신가요?
네, 쪽지를 보내주세요.
무지한 점 양해해 주십시오. PM을 보내는 방법을 어떻게 해야 하는지 궁금합니다. 어디서 보내야 하는지 명확하지가 않았습니다. 아니면 abboud at cedrus dot com으로 이메일을 직접 보내셔도 됩니다.
수입 관련 질문: vBulletin 기반 포럼의 일부 게시글에는 같은 포럼 내 다른 게시글로 연결되는 링크가 있습니다. 이러한 링크가 가져오기 시 변환되나요? 그렇지 않다면 어떻게 처리되나요? 삭제되나요?
현재 버전이 이를 재작성하는지 기억이 나지 않습니다. 제가 가지고 있는 스크립트(PR을 제출할 예정입니다)는 이를 수정합니다.


