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.
I did a little bit more digging and found that the base image change from Ubuntu 16.04 to debian is certainly the culprit for why mysql is no longer available, but still baffled on how to get mysql2 to connect to MariaDB.
I submitted a PR a while back that makes the mysql-dep.template.yml use MariaDB. I’ve used it several times.
It looks like you are trying not to use a password? I recommend using a password. The script assumes that there is a password.
Got it. I’ll try setting a password and seeing if that works. From what I gather though the import script should still work with MariaDB. If so I’ll keep troubleshooting. Thank you for the quick help!
@pfaffman That was it! Thank you so much. Once I get my forum in order I can send a pr for a VB3 version I had in case it’ll be useful to anyone.
This is also my test instance so I’m ok posting the details, it’s going to get torn down 
Thank you all for the help, the migration went mostly well. There were a couple missing attachments here and there but overall this went great.
For those reading in the future I migrated from Vb3.8.7
I needed to make some edits to the sql query in vbulletin.rb, as my database structure didn’t exactly match the script but it was pretty close. I decided to give up the custom captions to get things moving.
Github diff: File fix other by canyon289 · Pull Request #1 · canyon289/discourse · GitHub
For the MariaDB installation that replaces mysql I used the following command.
apt-get update && apt-get install mariadb-server-10.3 libmariadbd-dev
and to change my MariaDB password from null to a value this link was the most comprehensive
Again I can’t thank the people in this thread enough, and all the contributors to discourse for code and help!
I just finished a migration, and it gave all 2,000+ topics a category inherited from the vBulletin 4 instance. It will not let me delete this category and set all these migrated posts back to no selected category. “Can’t delete this category because it has 2322 topics”
Is there a workaround for this?
Either re-migrate or change the category on those topics. With that many you will need to do it from the Ruby command line.
你好,
我不确定这个的具体背景。
“将附件复制到你的 Discourse 实例(路径请检查你的 VB4 设置)。”
有人能帮忙吗?
你好,
我注意到有一个 vBulletin 5 的脚本,但我找不到任何关于它的反馈。本主题中的信息是否也适用于它?
谢谢!
该脚本的工作方式应非常相似。
正在为 vB4 安装运行导入,但在导入子类别时失败。请多包涵,我是一名 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)
我添加了一些调试输出来排查问题。类别中的 slug 值为 nil。
当循环遍历 create_categories(children_categories) do |category| 时,该类别看起来是有效的。我还在 def create_category(位于 base.rb 中)中,在调用 .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):
我们的开发人员尝试了该脚本,但进展有限。是否有人愿意以咨询方式为我们完成这项工作?
好的,请给我发私信。
请原谅我的无知,但我该如何发送私信?我没有找到明显的选项。或者您可以直接通过 abboud at cedrus dot com 给我发邮件。
关于导入的问题:我们基于 vBulletin 的论坛中有一些帖子包含指向同一论坛内其他帖子的链接。这些链接在导入时会被转换吗?如果不会,它们会发生什么变化?会被删除吗?
我不确定当前版本是否会重写它们。我有的这个脚本(我打算提交 PR)会修复它们。


