설명이 업데이트되어야 합니다. 2020년 11월 기준으로 제가 사용하는 방법은 다음과 같습니다. 이 가져오기를 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@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]