يجب تحديث التعليمات. إليك ما ينجح معي اعتبارًا من نوفمبر 2020. لاحظ أنه من الأفضل بالفعل تشغيل عملية الاستيراد هذه باستخدام أداة screen لأن الاستيراد قد يستغرق ساعات، واستخدام nohup قد لا يكون مفيدًا لأن سكريبت الاستيراد سيحدث باستمرار عدد العناصر المستوردة، مما قد يؤدي إلى أن يصبح ملف stdout كبيرًا جدًا.
تثبيت قاعدة البيانات لاستضافة بيانات vBulletin
تنزيل أحدث الحزم
لاحظ أن MySQL لم تعد متاحة إلا إذا تمت إضافة مستودع Oracle MySQL صراحةً إلى قائمة المستودعات. وقد حلت MariaDB محل MySQL.
root@uat-app:~# apt-get update
root@uat-app:~# apt-get install libmariadb-dev
root@uat-app:~# apt-get install default-mysql-server
بدء قاعدة البيانات
root@uat-app:~# service mysql status
[info] MariaDB is stopped..
root@uat-app:~#
root@uat-app:~# service mysql start
[ ok ] Starting MariaDB database server: mysqld.
root@uat-app:~# service mysql status
[info] /usr/bin/mysqladmin Ver 9.1 Distrib 10.3.25-MariaDB, for debian-linux-gnu on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Server version 10.3.25-MariaDB-0+deb10u1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 4 sec
Threads: 7 Questions: 461 Slow queries: 0 Opens: 177 Flush tables: 1 Open tables: 31 Queries per second avg: 115.250.
تثبيت مكتبات Gems للاتصال بقاعدة البيانات
يوضح ما يلي أن أحدث إصدار من ‘bundle’ لا يتوافق مع بعض الأعلام في التعليمات الأصلية، وهناك حاجة لإلغاء تعيين وضع ‘deployment’.
root@uat-app:~# echo "gem 'mysql2', require: false" >> /var/www/discourse/Gemfile
root@uat-app:~# echo "gem 'php_serialize', require: false" >> /var/www/discourse/Gemfile
root@uat-app:~# cd /var/www/discourse
root@uat-app:/var/www/discourse# su discourse -c 'bundle install --no-deployment --without test --without development --path vendor/bundle'
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path 'vendor/bundle'`, and stop using this flag
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'development'`, and stop using this flag
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
If this is a development machine, remove the /var/www/discourse/Gemfile freeze by running `bundle config unset deployment`.
The dependencies in your gemfile changed
You have added to the Gemfile:
* mysql2
* php_serialize
تحديث التكوين وإعادة تشغيل التثبيت
التحقق عبر سطر الأوامر (CLI)
أكد التحقق من التكوين أنه مضبوط على وضع ‘deployment’.
root@uat-app:/var/www/discourse# bundle config list
Settings are listed in order of priority. The top value will be used.
deployment
Set for your local app (/var/www/discourse/.bundle/config): true
jobs
Set for your local app (/var/www/discourse/.bundle/config): 4
retry
Set for your local app (/var/www/discourse/.bundle/config): 3
path
Set for your local app (/var/www/discourse/.bundle/config): "vendor/bundle"
without
Set for your local app (/var/www/discourse/.bundle/config): [:development, :test]
التحقق عبر فحص ملف التكوين
يوضح ما يلي إجراء نفس الفحص عن طريق فحص ملف التكوين.
root@uat-app:/var/www/discourse# cat /var/www/discourse/.bundle/config
---
BUNDLE_DEPLOYMENT: "true"
BUNDLE_JOBS: "4"
BUNDLE_RETRY: "3"
BUNDLE_PATH: "vendor/bundle"
BUNDLE_WITHOUT: "development:test"
تحديث التكوين
root@uat-app:/var/www/discourse# bundle config set path 'vendor/bundle'
Your application has set path to "vendor/bundle". This will override the global value you are currently setting
root@uat-app:/var/www/discourse# bundle config set without 'development:test'
Your application has set without to "development:test". This will override the global value you are currently setting
root@uat-app:/var/www/discourse# bundle config unset deployment
التحقق من التكوين مرة أخرى
root@uat-app:/var/www/discourse# bundle config list
Settings are listed in order of priority. The top value will be used.
path
Set for your local app (/var/www/discourse/.bundle/config): "vendor/bundle"
Set for the current user (/root/.bundle/config): "vendor/bundle"
without
Set for your local app (/var/www/discourse/.bundle/config): [:development, :test]
Set for the current user (/root/.bundle/config): [:development, :test]
jobs
Set for your local app (/var/www/discourse/.bundle/config): 4
retry
Set for your local app (/var/www/discourse/.bundle/config): 3
محاولة التثبيت مرة أخرى
قم بتشغيل التثبيت مرة أخرى لمكتبات Gems واخرج من الحاوية.
root@uat-app:/var/www/discourse# su discourse -c 'bundle install'
...........
Bundle complete! 125 Gemfile dependencies, 163 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into `./vendor/bundle`
root@uat-app:/var/www/discourse# exit
إنشاء مجلد لبيانات vBulletin
إنشاء مجلد
[root@uat standalone]# pwd
/var/discourse/shared/standalone
[root@uat standalone]# mkdir vbulletin
نسخ قاعدة بيانات vBulletin
[root@uat standalone]# scp <login user>@<vbulletin server IP>:/home/backup/vbulletin/vbulletin-2020-11-14-03:30:01.sql.bz2 ./vbulletin/.
فك ضغط قاعدة بيانات vBulletin
[root@uat containers]# docker exec -it app bash
root@uat-app:/# cd /shared/vbulletin
root@uat-app:/shared/vbulletin# bunzip2 vbulletin-2020-11-14-03\:30\:01.sql.bz2
إعداد مصدر البيانات
إنشاء قاعدة بيانات vb4
root@uat-app:/shared/vbulletin# mysql -uroot -p -e 'CREATE DATABASE vb4'
Enter password:
استيراد vBulletin إلى MariaDB
root@uat-app:/shared/vbulletin# mysql -uroot -p vb4 < vbulletin-2020-11-14-03\:30\:01.sql
Enter password:
فك ضغط أرشيفات الملفات الشخصية
[root@uat vbulletin]# tar xvfz signaturepics.tar.gz
[root@uat vbulletin]# tar xvfz customavatars.tar.gz
[root@uat vbulletin]# tar xvfz customprofilepics.tar.gz
تحديث كلمة مرور root لقاعدة البيانات
root@uat-app:/var/www/discourse# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 77
Server version: 10.3.25-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)]> ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> quit
Bye
الاستيراد إلى Discourse
تعيين تفاصيل اتصال مصدر البيانات
[root@uat vbulletin]# export DB_NAME="vb4"
[root@uat vbulletin]# export DB_USER="root"
[root@uat vbulletin]# export DB_PW="1234"
[root@uat vbulletin]# export TABLE_PREFIX="vbulletin"
[root@uat vbulletin]# export ATTACHMENT_DIR='/shared/vbulletin'
[root@uat vbulletin]# export TIMEZONE="America/Vancouver"
[root@uat vbulletin]# cd /var/www/discourse
root@uat-app:/var/www/discourse# su discourse -c 'bundle exec ruby script/import_scripts/vbulletin.rb'
root:1234@localhost wants vb4
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
importing groups...
15 / 15 (100.0%) [3272 items/min] n]
importing users
117 / 11033 ( 1.1%) [145 items/min] in]