Migrer un forum vBulletin 4 vers Discourse

No budget for this. But. Maybe.

2 « J'aime »

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.

3 « J'aime »

Thank you, @pfaffman! This worked great.

4 « J'aime »

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.

2 « J'aime »

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.

https://github.com/discourse/discourse_docker/commit/b95ea6f77a250793dc8e33f5e54571294db543e6#diff-882bf22f18ee0c4eb3af760ec94920e2R3

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.

2 « J'aime »

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 :slight_smile:

3 « J'aime »

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!

5 « J'aime »

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.

1 « J'aime »

Bonjour,

Je ne suis pas certain du contexte de ceci.

Copiez les pièces jointes vers votre instance Discourse (pour le chemin, vérifiez vos paramètres VB4).

Quelqu’un peut-il s’il vous plaît aider ?

Bonjour,

J’ai remarqué qu’il existe un script pour vBulletin 5, mais je ne trouve aucun retour d’expérience à son sujet. Les informations de ce sujet s’appliquent-elles également à ce script ?

Merci !

1 « J'aime »

Le script devrait fonctionner de manière très similaire.

1 « J'aime »

L’exécution d’une importation pour une installation vB4 échoue lors de l’importation des catégories enfants. Merci de me supporter, je suis un débutant en 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)

J’ai ajouté une sortie de débogage pour diagnostiquer le problème. La valeur de slug dans la catégorie est nil.

La catégorie semble valide lorsqu’elle boucle sur create_categories(children_categories) do |category|. J’ai également fait journaliser opts, import_id et new_category (juste avant .save!) depuis def create_category dans base.rb. Tout semble valide par rapport à ce que les fonctions attendent.

Est-ce que quelqu’un a déjà rencontré cela ?

       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):
2 « J'aime »

Notre développeur a essayé le script, mais n’a pas pu aller très loin. Quelqu’un serait-il intéressé à le faire pour nous dans le cadre d’une mission de conseil ?

2 « J'aime »

Bien sûr, envoyez-moi un MP.

2 « J'aime »

Veuillez m’excuser pour mon ignorance, mais comment envoyer un MP ? Je n’ai pas trouvé cela évident. Sinon, vous pouvez m’envoyer un e-mail directement à l’adresse abboud@cedrus.com.

Question concernant l’importation : certains messages de notre forum basé sur vBulletin contiennent des liens vers d’autres messages du même forum. Ces liens sont-ils convertis lors de l’importation ? Sinon, que deviennent-ils ? Sont-ils supprimés ?

1 « J'aime »

Je ne me souviens pas si la version actuelle les réécrit. Le script que j’ai (que je compte soumettre via une PR) les corrige.

2 « J'aime »