미디어위키/미디어위키 설치 및 관리

Git으로 미디어위키(Mediawiki) 1.35 LTS 설치 - 전체 브랜치(버전 관리 가능)

씨실과 날실 2021. 5. 5. 09:00

안녕하세요. 씨실과 날실입니다.

위의 지난 글에서는 Git을 이용해 미디어위키의 특정 안정판(예시 - 1.35.2)만을 설치하는 방법에 대해 다루어 보았습니다. 위 링크 글을 통해 Git 사용법에 대해 아주 조금이나마 발을 담글 수 있습니다.

그러나 우리가 Git을 사용하는 이유는 여러 버전을 자유롭게 관리할 수 있는 이점때문입니다.

이번 글에서는 미디어위키의 여러 버전을 넘나드는 방법에 대해 알아보도록 하겠습니다.

 

서버 환경

WebServer : Apache2

DB : MariaDB 10.5

PHP : PHP: 7.4

Git : Git

Mediawiki : 1.31.14 / 1.35.2 LTS

미디어 설치 디렉터리명 : w

 

이하의 내용은 비개발자들을 대상으로 한 글로써, 간단한 Git을 이용한 미디어위키 버전 관리 방법을 설명하고 있습니다.

이 글을 보기 전에 아래의 이전 포스팅을 먼저 읽어 보시는 것을 추천드립니다.

이후의 연재는 위 글의 내용을 알고 있다는 것을 전제로 진행하도록 하겠습니다.

 

Git의 보다 전문적인 사용법은 위 링크 등을 참고하시기 바랍니다. 

 

미디어위키 설치

시스템 패키지 전체 업그레이드

study@study-VirtualBox:~$ sudo apt update

study@study-VirtualBox:~$ sudo apt upgrade

시스템 내 패키지들을 전체 업그레이드해줍니다.

참고로 이 명령은 실제 서버 관리자의 경우 권장하지 않으며 일반적인 데스크탑 사용자로서 실습 환경이거나 서버 ㅣㅇ용자가 구축자 개인 혼자일 때만 사용하시기 바랍니다.

 

작업할 디렉터리로 이동

study@study-VirtualBox:~$ cd /var/www/html

서버의 웹문서 루트 디렉터리로 이동해줍니다.

참고로 위 디렉터리 예시는 우분투에서 기본 저장소를 통해 Apache2를 설치했을 때 자동으로 설정되는 기본 디렉터리입니다.

 

미디어위키 Core 저장소 복제(Clone)

study@study-VirtualBox:/var/www/html$ sudo git clone https://gerrit.wikimedia.org/r/mediawiki/core.git w
'w'에 복제합니다...
remote: Counting objects: 18938, done
remote: Finding sources: 100% (22/22)
remote: Getting sizes: 100% (18/18)
remote: Compressing objects: 100% (208672/208672)
remote: Total 920374 (delta 4), reused 920356 (delta 0)
오브젝트를 받는 중: 100% (920374/920374), 284.23 MiB | 6.82 MiB/s, 완료.
델타를 알아내는 중: 100% (784120/784120), 완료.
파일을 갱신합니다: 100% (8177/8177), 완료.
study@study-VirtualBox:/var/www/html$ 

드디어 본격적으로 Git을 다룹니다. 지난번 연재에서는 --branch 브랜치명(예 : --branch REL1_35)를 붙여 특정 안정 릴리즈판만을 복제 했습니다만 여기서는 공개된 모든 브랜치를 이용하기 위해 해당 옵션을 붙이지 않고 복제합니다.

 

이용 가능한 모든 태그 확인

study@study-VirtualBox:/var/www/html$ cd w
study@study-VirtualBox:/var/www/html/w$ git tag -l | sort -V
1.1.0
1.2.0

- 중략 -

1.31.14

- 중략 -

1.32.6

- 중략 -

1.33.4

- 중략 -

1.34.4

- 중략 -

1.35.2
1.36.0-rc.0
wmf-1.36.0-wmf.31-testing
study@study-VirtualBox:/var/www/html/w$ 

각 브랜치는 태그로 추적이 가능합니다.

2021년 5월 초 현재 미디어위키에서 사용가능한 태그는 아래 접근 글에서 확인할 수 있습니다.

 

더보기

명령 실행 예시

study@study-VirtualBox:/var/www/html$ cd w
study@study-VirtualBox:/var/www/html/w$ git tag -l | sort -V
1.1.0
1.2.0
1.2.0rc1
1.2.0rc2
1.2.0rc3
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.2.6
1.3.0
1.3.0beta1
1.3.0beta2
1.3.0beta3
1.3.0beta4
1.3.0beta4a
1.3.0beta5
1.3.0beta6
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.3.6
1.3.7
1.3.8
1.3.9
1.3.10
1.3.11
1.3.12
1.3.13
1.3.14
1.3.15
1.3.16
1.3.17
1.3.18
1.4.0
1.4.0beta
1.4.0beta1
1.4.0beta2
1.4.0beta4
1.4.0beta5
1.4.0beta6
1.4.0rc1
1.4.1
1.4.2
1.4.3
1.4.4
1.4.5
1.4.6
1.4.7
1.4.8
1.4.9
1.4.10
1.4.11
1.4.12
1.4.13
1.4.14
1.4.15
1.5.0
1.5.0alpha1
1.5.0alpha2
1.5.0beta1
1.5.0beta2
1.5.0beta3
1.5.0beta4
1.5.0rc1
1.5.0rc2
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
1.5.7
1.5.8
1.6.0
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.6.6
1.6.7
1.6.8
1.6.9
1.6.10
1.6.11
1.6.12
1.7.0
1.7.1
1.7.2
1.7.3
1.8.0
1.8.1
1.8.2
1.8.3
1.8.4
1.8.5
1.9.0
1.9.0rc1
1.9.0rc2
1.9.1
1.9.2
1.9.3
1.9.4
1.9.5
1.9.6
1.10.0
1.10.0rc1
1.10.0rc2
1.10.1
1.10.2
1.10.3
1.10.4
1.11.0
1.11.0rc1
1.11.1
1.11.2
1.12.0
1.12.0rc1
1.12.1
1.12.2
1.12.3
1.12.4
1.13.0
1.13.0rc1
1.13.0rc2
1.13.1
1.13.2
1.13.3
1.13.4
1.13.5
1.14.0
1.14.0rc1
1.14.1
1.15.0
1.15.0rc1
1.15.1
1.15.2
1.15.3
1.15.4
1.15.5
1.16.0
1.16.0beta1
1.16.0beta2
1.16.0beta3
1.16.1
1.16.2
1.16.3
1.16.4
1.16.5
1.17.0
1.17.0beta1
1.17.0rc1
1.17.1
1.17.2
1.17.3
1.17.4
1.17.5
1.18.0
1.18.0beta1
1.18.0rc1
1.18.1
1.18.2
1.18.3
1.18.4
1.18.5
1.18.6
1.19.0
1.19.0beta1
1.19.0beta2
1.19.0rc1
1.19.1
1.19.2
1.19.3
1.19.4
1.19.5
1.19.6
1.19.7
1.19.8
1.19.9
1.19.10
1.19.11
1.19.12
1.19.13
1.19.14
1.19.15
1.19.16
1.19.17
1.19.18
1.19.19
1.19.20
1.19.21
1.19.22
1.19.23
1.19.24
1.20.0
1.20.0rc1
1.20.0rc2
1.20.1
1.20.2
1.20.3
1.20.4
1.20.5
1.20.6
1.20.7
1.20.8
1.21.0
1.21.1
1.21.2
1.21.3
1.21.4
1.21.5
1.21.6
1.21.7
1.21.8
1.21.9
1.21.10
1.21.11
1.22.0
1.22.0rc0
1.22.0rc1
1.22.0rc2
1.22.0rc3
1.22.0rc-FINAL
1.22.1
1.22.2
1.22.3
1.22.4
1.22.5
1.22.6
1.22.7
1.22.8
1.22.9
1.22.10
1.22.11
1.22.12
1.22.13
1.22.14
1.22.15
1.23.0
1.23.0rc0
1.23.0-rc.1
1.23.0-rc.2
1.23.0-rc.3
1.23.1
1.23.2
1.23.3
1.23.4
1.23.5
1.23.6
1.23.7
1.23.8
1.23.9
1.23.10
1.23.11
1.23.12
1.23.13
1.23.14
1.23.15
1.23.16
1.23.17
1.24.0
1.24.0-rc.0
1.24.0-rc.1
1.24.0-rc.2
1.24.0-rc.3
1.24.1
1.24.2
1.24.3
1.24.4
1.24.5
1.24.6
1.25.0
1.25.0-rc.0
1.25.1
1.25.2
1.25.3
1.25.4
1.25.5
1.25.6
1.26.0
1.26.1
1.26.2
1.26.3
1.26.4
1.27.0
1.27.0-rc.0
1.27.0-rc.1
1.27.1
1.27.2
1.27.3
1.27.4
1.27.5
1.27.6
1.27.7
1.28.0
1.28.0-rc.0
1.28.0-rc.1
1.28.1
1.28.2
1.28.3
1.29.0
1.29.0-rc.0
1.29.0-rc.1
1.29.1
1.29.2
1.29.3
1.30.0
1.30.0-rc.0
1.30.1
1.30.2
1.31.0
1.31.0-rc.0
1.31.0-rc.1
1.31.0-rc.2
1.31.1
1.31.2
1.31.3
1.31.4
1.31.5
1.31.6
1.31.7
1.31.8
1.31.9
1.31.10
1.31.11
1.31.12
1.31.13
1.31.14
1.32.0
1.32.0-rc.0
1.32.0-rc.1
1.32.0-rc.2
1.32.1
1.32.2
1.32.3
1.32.4
1.32.5
1.32.6
1.33.0
1.33.0-rc.0
1.33.1
1.33.2
1.33.3
1.33.4
1.34.0
1.34.0-rc.0
1.34.0-rc.1
1.34.1
1.34.2
1.34.3
1.34.4
1.35.0
1.35.0-rc.0
1.35.0-rc.1
1.35.0-rc.2
1.35.0-rc.3
1.35.1
1.35.2
1.36.0-rc.0
wmf-1.36.0-wmf.31-testing
study@study-VirtualBox:/var/www/html/w$ 

 

 

사용할 브랜치의 태그 지정

study@study-VirtualBox:/var/www/html/w$ sudo git checkout 1.31.14
파일을 갱신합니다: 100% (10591/10591), 완료.
Note: switching to '1.31.14'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD의 현재 위치는 94cbdfbc50 Prep 1.31.14
study@study-VirtualBox:/var/www/html/w$ 

미디어위키의 깃 저장소를 복제(Clone)했다면 이제 사용할 브랜치를 지정해주어야합니다.

여기서는 태그를 이용해 지정해주었습니다.

 

참고로 이 글이 공개된 당시의 미디어위키 최신 안정 릴리즈판은 1.35.2 LTS입니다.

그러나 뒤에 나올  브랜치 전환 실습을 위해 바로 직전 LTS 버전인 1.31.14로 체크아웃했습니다.  

 

스킨, 익스텐션 외부 라이브러리를 위한 하위 모듈 설치

study@study-VirtualBox:/var/www/html/w$ sudo git submodule update --init --recursive
'extensions/CategoryTree' 경로에 대해 'extensions/CategoryTree' (https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree) 하위 모듈 등록
'extensions/Cite' 경로에 대해 'extensions/Cite' (https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite) 하위 모듈 등록
'extensions/CiteThisPage' 경로에 대해 'extensions/CiteThisPage' (https://gerrit.wikimedia.org/r/mediawiki/extensions/CiteThisPage) 하위 모듈 등록
'extensions/CodeEditor' 경로에 대해 'extensions/CodeEditor' (https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor) 하위 모듈 등록
'extensions/ConfirmEdit' 경로에 대해 'extensions/ConfirmEdit' (https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit) 하위 모듈 등록
'extensions/Gadgets' 경로에 대해 'extensions/Gadgets' (https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets) 하위 모듈 등록
'extensions/ImageMap' 경로에 대해 'extensions/ImageMap' (https://gerrit.wikimedia.org/r/mediawiki/extensions/ImageMap) 하위 모듈 등록
'extensions/InputBox' 경로에 대해 'extensions/InputBox' (https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox) 하위 모듈 등록
'extensions/Interwiki' 경로에 대해 'extensions/Interwiki' (https://gerrit.wikimedia.org/r/mediawiki/extensions/Interwiki) 하위 모듈 등록
'extensions/LocalisationUpdate' 경로에 대해 'extensions/LocalisationUpdate' (https://gerrit.wikimedia.org/r/mediawiki/extensions/LocalisationUpdate) 하위 모듈 등록
'extensions/MultimediaViewer' 경로에 대해 'extensions/MultimediaViewer' (https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer) 하위 모듈 등록
'extensions/Nuke' 경로에 대해 'extensions/Nuke' (https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke) 하위 모듈 등록
'extensions/OATHAuth' 경로에 대해 'extensions/OATHAuth' (https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth) 하위 모듈 등록
'extensions/ParserFunctions' 경로에 대해 'extensions/ParserFunctions' (https://gerrit.wikimedia.org/r/mediawiki/extensions/ParserFunctions) 하위 모듈 등록
'extensions/PdfHandler' 경로에 대해 'extensions/PdfHandler' (https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler) 하위 모듈 등록
'extensions/Poem' 경로에 대해 'extensions/Poem' (https://gerrit.wikimedia.org/r/mediawiki/extensions/Poem) 하위 모듈 등록
'extensions/Renameuser' 경로에 대해 'extensions/Renameuser' (https://gerrit.wikimedia.org/r/mediawiki/extensions/Renameuser) 하위 모듈 등록
'extensions/ReplaceText' 경로에 대해 'extensions/ReplaceText' (https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText) 하위 모듈 등록
'extensions/SpamBlacklist' 경로에 대해 'extensions/SpamBlacklist' (https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist) 하위 모듈 등록
'extensions/SyntaxHighlight_GeSHi' 경로에 대해 'extensions/SyntaxHighlight_GeSHi' (https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi) 하위 모듈 등록
'extensions/TitleBlacklist' 경로에 대해 'extensions/TitleBlacklist' (https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist) 하위 모듈 등록
'extensions/WikiEditor' 경로에 대해 'extensions/WikiEditor' (https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor) 하위 모듈 등록
'skins/MonoBook' 경로에 대해 'skins/MonoBook' (https://gerrit.wikimedia.org/r/mediawiki/skins/MonoBook) 하위 모듈 등록
'skins/Timeless' 경로에 대해 'skins/Timeless' (https://gerrit.wikimedia.org/r/mediawiki/skins/Timeless) 하위 모듈 등록
'skins/Vector' 경로에 대해 'skins/Vector' (https://gerrit.wikimedia.org/r/mediawiki/skins/Vector) 하위 모듈 등록
'vendor' 경로에 대해 'vendor' (https://gerrit.wikimedia.org/r/mediawiki/vendor) 하위 모듈 등록
'/var/www/html/w/extensions/CategoryTree'에 복제합니다...
'/var/www/html/w/extensions/Cite'에 복제합니다...
'/var/www/html/w/extensions/CiteThisPage'에 복제합니다...
'/var/www/html/w/extensions/CodeEditor'에 복제합니다...
'/var/www/html/w/extensions/ConfirmEdit'에 복제합니다...
'/var/www/html/w/extensions/Gadgets'에 복제합니다...
'/var/www/html/w/extensions/ImageMap'에 복제합니다...
'/var/www/html/w/extensions/InputBox'에 복제합니다...
'/var/www/html/w/extensions/Interwiki'에 복제합니다...
'/var/www/html/w/extensions/LocalisationUpdate'에 복제합니다...
'/var/www/html/w/extensions/MultimediaViewer'에 복제합니다...
'/var/www/html/w/extensions/Nuke'에 복제합니다...
'/var/www/html/w/extensions/OATHAuth'에 복제합니다...
'/var/www/html/w/extensions/ParserFunctions'에 복제합니다...
'/var/www/html/w/extensions/PdfHandler'에 복제합니다...
'/var/www/html/w/extensions/Poem'에 복제합니다...
'/var/www/html/w/extensions/Renameuser'에 복제합니다...
'/var/www/html/w/extensions/ReplaceText'에 복제합니다...
'/var/www/html/w/extensions/SpamBlacklist'에 복제합니다...
'/var/www/html/w/extensions/SyntaxHighlight_GeSHi'에 복제합니다...
'/var/www/html/w/extensions/TitleBlacklist'에 복제합니다...
'/var/www/html/w/extensions/WikiEditor'에 복제합니다...
'/var/www/html/w/skins/MonoBook'에 복제합니다...
'/var/www/html/w/skins/Timeless'에 복제합니다...
'/var/www/html/w/skins/Vector'에 복제합니다...
'/var/www/html/w/vendor'에 복제합니다...
하위 모듈 경로 'extensions/CategoryTree': '6933f5bb647ef22b78d813fa944debb01fc16c2b' 체크아웃
하위 모듈 경로 'extensions/Cite': 'db249bae3d2c87f5a98082ddbd96a619d35bea75' 체크아웃
하위 모듈 경로 'extensions/CiteThisPage': '1b8edf2b51d2cf8babe7cbeb5c6fe2b6098c7be1' 체크아웃
하위 모듈 경로 'extensions/CodeEditor': '4203f2bbd5b7521b2274ca3068a03d052f4afb93' 체크아웃
하위 모듈 경로 'extensions/ConfirmEdit': '65f34763f326a912622af9eddcca574c78c02fa9' 체크아웃
하위 모듈 경로 'extensions/Gadgets': '7ab92a1c89f17b235dc8b96bacb95a49e117ed5b' 체크아웃
하위 모듈 경로 'extensions/ImageMap': '4a45ba4a3bfd29c3ffbcaff8ac639941dc670969' 체크아웃
하위 모듈 경로 'extensions/InputBox': '2ab0a1405878e9c81591d976e034eca0bd900305' 체크아웃
하위 모듈 경로 'extensions/Interwiki': '718e96a3db73fd6939c1a1186c01132efe807e79' 체크아웃
하위 모듈 경로 'extensions/LocalisationUpdate': 'ac299fe1df86742619a6b44310f39724e82d394f' 체크아웃
하위 모듈 경로 'extensions/MultimediaViewer': '697136234aa78cca0cadee2f10410d99f7387d17' 체크아웃
하위 모듈 경로 'extensions/Nuke': '5147db3e50f3f0dd6d2e611c6b4dff597a8ab10e' 체크아웃
하위 모듈 경로 'extensions/OATHAuth': 'b11fea365909c289f5929a2e961359ae10c67016' 체크아웃
하위 모듈 경로 'extensions/ParserFunctions': '9541d8907b5f804c2960e100d7b29ec9945fdc82' 체크아웃
하위 모듈 경로 'extensions/PdfHandler': '491f057637543c463c3196ee3049de9521b9a56d' 체크아웃
하위 모듈 경로 'extensions/Poem': '48f4b1d8f2a947beaf76dc90517a88bd55cecbba' 체크아웃
하위 모듈 경로 'extensions/Renameuser': 'e92f315a4f0744ee86fbb3aa72e6f855f72ba6df' 체크아웃
하위 모듈 경로 'extensions/ReplaceText': 'be197b8c577450fc2b9fa8e09acdcc511ef81a27' 체크아웃
하위 모듈 경로 'extensions/SpamBlacklist': '793c8f155ae2d411b43dc75670078bcfe6e76513' 체크아웃
하위 모듈 경로 'extensions/SyntaxHighlight_GeSHi': 'f0dca73bebddd4640a8582425385cd5aac4cc83e' 체크아웃
하위 모듈 경로 'extensions/TitleBlacklist': 'a3124b6829ae216148ab52f5900d8beb2f2407f6' 체크아웃
하위 모듈 경로 'extensions/WikiEditor': 'b5647a7d7c4b47f8da3f9614f3fd295dd20f5a12' 체크아웃
하위 모듈 경로 'skins/MonoBook': 'c3f80c402b2aefb7b0f32e101fdbc36537d5e147' 체크아웃
하위 모듈 경로 'skins/Timeless': 'f90234655a470aa1100b49a88ac89d403e487320' 체크아웃
하위 모듈 경로 'skins/Vector': '06292be20054ccef4cb3f1a6fb5152ad55d11b47' 체크아웃
하위 모듈 경로 'vendor': '1521f359a06aed626e860285769ed78a7152cdec' 체크아웃
study@study-VirtualBox:/var/www/html/w$ 

이전 연재글에서도 설명했습니다만 미디어위키 공식 배포 압축 아카이브 파일(zip, tar.gz)과는 달리 Git을 이용해 복제하는 미디어위키 내용은 미디어위키의 Core 부분에 해당하는 것으로 서드파티 개발 가능 영역(스킨, 익스텐션, 벤더)은 미디어위키의 하위 모듈에 해당하여 위와 같이 따로 업데이트해주어야 합니다.

 

미디어위키 인스톨

미디어위키는 터미널 환경에서 설치할 수도 있고 웹브라우저 환경에서 설치할 수도 있습니다.

자신에게 주어진 환경을 고려하여 자신에게 편한 방법을 이용해 설치해주시면 됩니다.

 

미디어위키 설정 파일 생성

study@study-VirtualBox:/var/www/html/w$ sudo nano LocalSettings.php

미디어위키를 터미널 환경에서 설치하면 설정 파일을 자동으로 생성해주지만 웹브라우저 환경에서 설치를 진행하는 경우 자동으로 생성된 설정 파일을 따로 미디어위키 디렉터리에 저장해주어야 하는 번거로움이 있습니다.

 

이것으로 1.31.14 버전의 미디어위키 설치가 완료되었습니다.


해당 브랜치 최신으로 유지 업데이트

이번 파트는 Git을 잘다루는 분이 아니라면 가능하면 실행하지 않는 것을 권장하지 않습니다.

Git을 잘 다루지 못한다면 문제 발생 시 복구가 힘들 수도 있기 때문입니다.

이 파트의 보다 자세한 내용은 우 링크 글을 참고하시기 바랍니다.

 

study@study-VirtualBox:/var/www/html/w$ sudo git pull
현재 어떤 브랜치 위에도 있지 않습니다.
어떤 브랜치를 대상으로 병합할지 지정하십시오.
자세한 정보는 git-pull(1) 페이지를 참고하십시오.

    git pull <리모트> <브랜치>

study@study-VirtualBox:/var/www/html/w$ 

미디어위키 Core의 최신 변경 사항을 적용하는 방법입니다.

 

study@study-VirtualBox:/var/www/html/w$ sudo git pull --recurse-submodules
Fetching submodule extensions/CategoryTree
Fetching submodule extensions/Cite
Fetching submodule extensions/CiteThisPage
Fetching submodule extensions/CodeEditor
Fetching submodule extensions/ConfirmEdit
Fetching submodule extensions/Gadgets
Fetching submodule extensions/ImageMap
Fetching submodule extensions/InputBox
Fetching submodule extensions/Interwiki
Fetching submodule extensions/LocalisationUpdate
Fetching submodule extensions/MultimediaViewer
Fetching submodule extensions/Nuke
Fetching submodule extensions/OATHAuth
Fetching submodule extensions/ParserFunctions
Fetching submodule extensions/PdfHandler
Fetching submodule extensions/Poem
Fetching submodule extensions/Renameuser
Fetching submodule extensions/ReplaceText
Fetching submodule extensions/SpamBlacklist
Fetching submodule extensions/SyntaxHighlight_GeSHi
Fetching submodule extensions/TitleBlacklist
Fetching submodule extensions/WikiEditor
Fetching submodule skins/MonoBook
Fetching submodule skins/Timeless
Fetching submodule skins/Vector
Fetching submodule vendor
현재 어떤 브랜치 위에도 있지 않습니다.
어떤 브랜치를 대상으로 병합할지 지정하십시오.
자세한 정보는 git-pull(1) 페이지를 참고하십시오.

    git pull <리모트> <브랜치>

study@study-VirtualBox:/var/www/html/w$

위는 미디어위키의 하위모듈까지 최신으로 업데이트하는 명령입니다.

 

study@study-VirtualBox:/var/www/html/w$ sudo composer update --no-dev

때에 따라서는 필수 라이브러리도 업데이트해주어야 할 때가 있습니다.

라이브러리 업데이트 방법은 위와 같이 Composer를 이용하는 방법이 있고 미디어위키 측에서 권장하는 방법이기도 합니다만 그외에 git clone 명령을 통해 따로 업데이트할 수도 있습니다.

개인적으로 비개발자라면 미디어위키의 권장 방법인 Composer를 이용한 라이브러리 관리는 권장하지 않습니다.

미디어위키 버전 변경 후 워나상복구할 때 문제가 발생할 수도 있습니다.

 

study@study-VirtualBox:/var/www/html/w$ sudo php maintenance/update.php

이후 때에 따라 미디어위키 DB의 테이블을 업데이트해줘야 할 때도 있습니다.


미디어위키 DB 백업

여기서는 미디어위키의 버전을 업그레니드 또는 다운그레이드 이후 맞닿뜨리게 될 지도 모르는 오류 발생에 대비해 기존 버전으로 되돌릴 수 있도록 기존 버전의 DB를 백업해두는 과정을 진행합니다.

 

미디어위키 DB 정보 확인

study@study-VirtualBox:/var/www/html/w$ sudo egrep -i '(\$wgDBserver|\$wgDBname|\$wgDBuser|\$wgDBpassword|\$wgDBTableOptions)' LocalSettings.php
[sudo] study의 암호: 
$wgDBserver = "localhost";
$wgDBname = "my_wiki";
$wgDBuser = "root";
$wgDBpassword = "xxxxxxxxxx";
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
study@study-VirtualBox:/var/www/html/w$ 

서버 관리자 또는 미디어위키 관리자라면 DB 관리에 필요한 각종 정보를 알고 있어야 합니다. 그러나 그것을 일일이 외우고 있기란 쉬운 일은 아닙니다. 특히 관리 서버가 많다면 더더욱 그럴 것입니다. 그외에 기존 관리자가 아니라 도중에 인수받은 관리자인데 전임자로부터 제대로 인수인계를 받지 못한 경우도 있을 것이고 말입니다.

 

이럴 때 자신이 서버 관리자라면 위와 같이 미디어위키 DB 관리에 필요한 정보를 확인할 수 있습니다.

 

미디어위키 DB 백업

study@study-VirtualBox:~$ mysqldump -h localhost -u root -p --default-character-set=binary my_wiki > backup_mw1.31.sql
Enter password: 
study@study-VirtualBox:~$ 

아까 확인한 정보를 토대로 미디어위키의 DB를 백업합니다.

 

DB 백업 파일 확인

study@study-VirtualBox:~$ ls -l | grep *.sql
-rw-rw-r-- 1 study study 2349073  5월  1 16:29 backup_mw1.31.sql
study@study-VirtualBox:~$ 

제대로 백업되었는지 위와 같이 확인합니다.


미디어위키 상위 버전으로 전환

미디어위키 디렉터리로 이동

study@study-VirtualBox:~$ cd /var/www/html/w
study@study-VirtualBox:/var/www/html/w$ 

미디어위키 디렉터리로 이동해줍니다.

 

미디어위키 버전 전환

study@study-VirtualBox:/var/www/html/w$ sudo git checkout 1.35.2
파일을 갱신합니다: 100% (10335/10335), 완료.
M	extensions/CategoryTree
M	extensions/Cite
M	extensions/CiteThisPage
M	extensions/CodeEditor
M	extensions/ConfirmEdit
M	extensions/Gadgets
M	extensions/ImageMap
M	extensions/InputBox
M	extensions/Interwiki
M	extensions/LocalisationUpdate
M	extensions/MultimediaViewer
M	extensions/Nuke
M	extensions/OATHAuth
M	extensions/ParserFunctions
M	extensions/PdfHandler
M	extensions/Poem
M	extensions/Renameuser
M	extensions/ReplaceText
M	extensions/SpamBlacklist
M	extensions/SyntaxHighlight_GeSHi
M	extensions/TitleBlacklist
M	extensions/WikiEditor
M	skins/MonoBook
M	skins/Timeless
M	skins/Vector
M	vendor
이전 HEAD 위치는 94cbdfbc50 Prep 1.31.14
HEAD의 현재 위치는 e5823c068a Prep 1.35.2
study@study-VirtualBox:/var/www/html/w$ 

Git의 체크아웃 명령으로 변경할 브랜치 또는 태그를 지정해줍니다.

여기서는 태그를 이용해 버전을 바꾸어 주었습니다.

미디어위키를 Git으로 처음 설치할 땐 1.31.14으로 체크아웃했지만 이번에 1.35.2로 체크아웃한 것입니다.

 

하위 모듈 업데이트

study@study-VirtualBox:/var/www/html/w$ sudo git submodule update --init --recursive
'extensions/PageImages' 경로에 대해 'extensions/PageImages' (https://gerrit.wikimedia.org/r/mediawiki/extensions/PageImages) 하위 모듈 등록
'extensions/Scribunto' 경로에 대해 'extensions/Scribunto' (https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto) 하위 모듈 등록
'extensions/SecureLinkFixer' 경로에 대해 'extensions/SecureLinkFixer' (https://gerrit.wikimedia.org/r/mediawiki/extensions/SecureLinkFixer) 하위 모듈 등록
'extensions/TemplateData' 경로에 대해 'extensions/TemplateData' (https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData) 하위 모듈 등록
'extensions/TextExtracts' 경로에 대해 'extensions/TextExtracts' (https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts) 하위 모듈 등록
'extensions/VisualEditor' 경로에 대해 'extensions/VisualEditor' (https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor) 하위 모듈 등록
'/var/www/html/w/extensions/PageImages'에 복제합니다...
'/var/www/html/w/extensions/Scribunto'에 복제합니다...
'/var/www/html/w/extensions/SecureLinkFixer'에 복제합니다...
'/var/www/html/w/extensions/TemplateData'에 복제합니다...
'/var/www/html/w/extensions/TextExtracts'에 복제합니다...
'/var/www/html/w/extensions/VisualEditor'에 복제합니다...
하위 모듈 경로 'extensions/CategoryTree': '6a69f1ade607add20b119bd91fd34525edf1049c' 체크아웃
하위 모듈 경로 'extensions/Cite': 'bc16b0527f34f002d327154092cc05a5d2dcb0b9' 체크아웃
하위 모듈 경로 'extensions/CiteThisPage': '8726d121cd942abc94aa7b4621132b87f26714e5' 체크아웃
하위 모듈 경로 'extensions/CodeEditor': '1fafe27dc395ba1bc636f69fca15e1bb5a59caae' 체크아웃
하위 모듈 경로 'extensions/ConfirmEdit': 'eceeda60d620499a6f6990b08b0d5a264606c2de' 체크아웃
하위 모듈 경로 'extensions/Gadgets': '03b8b5d8b6299c3fe95e8a792dee9304a79692f3' 체크아웃
하위 모듈 경로 'extensions/ImageMap': '7c250466b476c62ac80d797f107760981b980f9f' 체크아웃
하위 모듈 경로 'extensions/InputBox': '68d995badf9c28bbb706d263257d63a18e5fb800' 체크아웃
하위 모듈 경로 'extensions/Interwiki': '224d4befa00fa980523ab921368a14dc0230f468' 체크아웃
하위 모듈 경로 'extensions/LocalisationUpdate': '49cb2803c5e07e72c5eb65714aa4f4a6bae0e3c3' 체크아웃
하위 모듈 경로 'extensions/MultimediaViewer': '4b3219b60eb6c3b9718ff18887610e29cb88cc69' 체크아웃
하위 모듈 경로 'extensions/Nuke': '0a74305a9a35fb5411ab0668cea167a53f0657fc' 체크아웃
하위 모듈 경로 'extensions/OATHAuth': '2479f52deaff2efd8b556bf9d81c67b769c6a7f1' 체크아웃
하위 모듈 경로 'extensions/PageImages': '20909a1c3c26465c2999235d6b37970a045a1126' 체크아웃
하위 모듈 경로 'extensions/ParserFunctions': '5c84940834662a74b5b3f18fadeb5df133f1e8dc' 체크아웃
하위 모듈 경로 'extensions/PdfHandler': 'a2ab93f4f3096d8da91f9ca9866b26ad692c7850' 체크아웃
하위 모듈 경로 'extensions/Poem': '23bd68e266f5a39eff31de31a80701f2b49e09d5' 체크아웃
하위 모듈 경로 'extensions/Renameuser': '3bcbd8d2d17ae3c01506066e91ab0206f05fdcfc' 체크아웃
하위 모듈 경로 'extensions/ReplaceText': 'feb8a9ce7fc3f809067142a438242de5f9211599' 체크아웃
하위 모듈 경로 'extensions/Scribunto': 'd21b655d99b60ee678538125c3f323f30b748bf6' 체크아웃
하위 모듈 경로 'extensions/SecureLinkFixer': '47f12670b23b5a59e7fdd1a2bd9b5a49693940c8' 체크아웃
하위 모듈 경로 'extensions/SpamBlacklist': '092e4881d136f68b455cb87217b045fa1e8b28fa' 체크아웃
하위 모듈 경로 'extensions/SyntaxHighlight_GeSHi': '0e4cce61224b64b2eced7b6ba6d3830e88ad1c2b' 체크아웃
하위 모듈 경로 'extensions/TemplateData': 'ba41c7d0b1b803167d0f33a615733310132133a0' 체크아웃
하위 모듈 경로 'extensions/TextExtracts': 'f225c911a70832bf370e457fe5cee2702faa95b1' 체크아웃
하위 모듈 경로 'extensions/TitleBlacklist': '84c647d9151ce9328b06f8b66784d49db097e894' 체크아웃
하위 모듈 경로 'extensions/VisualEditor': '07ed2531f268c14d05e8de5d0b91a241b45d9534' 체크아웃
'extensions/VisualEditor/lib/ve' 경로에 대해 'lib/ve' (https://gerrit.wikimedia.org/r/VisualEditor/VisualEditor.git) 하위 모듈 등록
'/var/www/html/w/extensions/VisualEditor/lib/ve'에 복제합니다...
하위 모듈 경로 'extensions/VisualEditor/lib/ve': '504e7d258fd402ddd9fe1d3fe80aced2120cf439' 체크아웃
하위 모듈 경로 'extensions/WikiEditor': '9bc2d0b806a33777fd66afb5e272203f735567e8' 체크아웃
하위 모듈 경로 'skins/MonoBook': '3a638f64e703cc13c7c3162c1ef4726663fbe92a' 체크아웃
하위 모듈 경로 'skins/Timeless': 'c2b39e7b08ffa210c6cda09ee4da89a0b3e64345' 체크아웃
하위 모듈 경로 'skins/Vector': '57326a0290555d8f70d9cbbf819c2494d15d5957' 체크아웃
하위 모듈 경로 'vendor': '327fc312540fd77b35651e4a167dd9645888a3a0' 체크아웃
study@study-VirtualBox:/var/www/html/w$ 

미디어위키 Core 버전을 1.31.14에서 1.35.2로 바꾼 만큼 하위모듈들(스킨, 익스텐션, 외부 라이브러리)도 그에 맞게 업데이트해줍니다.

 

위 진행 과정을 보면 알 수 있듯이  --init --recursive 옵션을 붙이면 1.31 버전에는 없었지만 1.35 버전에 새로 추가된 익스텐션 등도 함께 새로 복제됩니다.

 

study@study-VirtualBox:/var/www/html/w$ sudo git submodule update
하위 모듈 경로 'extensions/CategoryTree': '6a69f1ade607add20b119bd91fd34525edf1049c' 체크아웃
하위 모듈 경로 'extensions/Cite': 'bc16b0527f34f002d327154092cc05a5d2dcb0b9' 체크아웃
하위 모듈 경로 'extensions/CiteThisPage': '8726d121cd942abc94aa7b4621132b87f26714e5' 체크아웃
하위 모듈 경로 'extensions/CodeEditor': '1fafe27dc395ba1bc636f69fca15e1bb5a59caae' 체크아웃
하위 모듈 경로 'extensions/ConfirmEdit': 'eceeda60d620499a6f6990b08b0d5a264606c2de' 체크아웃
하위 모듈 경로 'extensions/Gadgets': '03b8b5d8b6299c3fe95e8a792dee9304a79692f3' 체크아웃
하위 모듈 경로 'extensions/ImageMap': '7c250466b476c62ac80d797f107760981b980f9f' 체크아웃
하위 모듈 경로 'extensions/InputBox': '68d995badf9c28bbb706d263257d63a18e5fb800' 체크아웃
하위 모듈 경로 'extensions/Interwiki': '224d4befa00fa980523ab921368a14dc0230f468' 체크아웃
하위 모듈 경로 'extensions/LocalisationUpdate': '49cb2803c5e07e72c5eb65714aa4f4a6bae0e3c3' 체크아웃
하위 모듈 경로 'extensions/MultimediaViewer': '4b3219b60eb6c3b9718ff18887610e29cb88cc69' 체크아웃
하위 모듈 경로 'extensions/Nuke': '0a74305a9a35fb5411ab0668cea167a53f0657fc' 체크아웃
하위 모듈 경로 'extensions/OATHAuth': '2479f52deaff2efd8b556bf9d81c67b769c6a7f1' 체크아웃
하위 모듈 경로 'extensions/ParserFunctions': '5c84940834662a74b5b3f18fadeb5df133f1e8dc' 체크아웃
하위 모듈 경로 'extensions/PdfHandler': 'a2ab93f4f3096d8da91f9ca9866b26ad692c7850' 체크아웃
하위 모듈 경로 'extensions/Poem': '23bd68e266f5a39eff31de31a80701f2b49e09d5' 체크아웃
하위 모듈 경로 'extensions/Renameuser': '3bcbd8d2d17ae3c01506066e91ab0206f05fdcfc' 체크아웃
하위 모듈 경로 'extensions/ReplaceText': 'feb8a9ce7fc3f809067142a438242de5f9211599' 체크아웃
하위 모듈 경로 'extensions/SpamBlacklist': '092e4881d136f68b455cb87217b045fa1e8b28fa' 체크아웃
하위 모듈 경로 'extensions/SyntaxHighlight_GeSHi': '0e4cce61224b64b2eced7b6ba6d3830e88ad1c2b' 체크아웃
하위 모듈 경로 'extensions/TitleBlacklist': '84c647d9151ce9328b06f8b66784d49db097e894' 체크아웃
하위 모듈 경로 'extensions/WikiEditor': '9bc2d0b806a33777fd66afb5e272203f735567e8' 체크아웃
하위 모듈 경로 'skins/MonoBook': '3a638f64e703cc13c7c3162c1ef4726663fbe92a' 체크아웃
하위 모듈 경로 'skins/Timeless': 'c2b39e7b08ffa210c6cda09ee4da89a0b3e64345' 체크아웃
하위 모듈 경로 'skins/Vector': '57326a0290555d8f70d9cbbf819c2494d15d5957' 체크아웃
하위 모듈 경로 'vendor': '327fc312540fd77b35651e4a167dd9645888a3a0' 체크아웃
study@study-VirtualBox:/var/www/html/w$ 

만약 --init --recursive 옵션 없이 진행하면 1.35 버전에 추가된 익스텐션은 복제되지 않고 기존에 설치되어 있었던 하위모듈들만 새 버전에 맞춰 업그레이드됩니다.

 

미디어위키 DB 업데이트

study@study-VirtualBox:/var/www/html/w$ sudo php maintenance/update.php
MediaWiki 1.35.2 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for my_wiki-w_
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0

- 중략 -

Updated a total of 0 rows
Copying IP revisions to ip_changes, from rev_id 0 to rev_id 1
...checking 1 revisions for IP edits that need copying, between rev_ids 0 and 1
Attempted to insert 0 IP revisions, 0 actually done.
Updating externallinks table index fields
Done, 0 rows updated, 0 deleted.
Purging caches...done.

Done in 3.0 s.
study@study-VirtualBox:/var/www/html/w$ 

자세한 DB 업데이트 진행 가정 예시는 아래를 참고하시기 바랍니다.

더보기

미디어위키 DB 업데이트 과정

study@study-VirtualBox:/var/www/html/w$ sudo php maintenance/update.php
MediaWiki 1.35.2 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for my_wiki-w_
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0
...have ipb_id field in ipblocks table.
...have ipb_expiry field in ipblocks table.
...already have interwiki table
...indexes seem up to 20031107 standards.
...have rc_type field in recentchanges table.
...index new_name_timestamp already set on recentchanges table.
...have user_real_name field in user table.
...querycache table already exists.
...objectcache table already exists.
...categorylinks table already exists.
...have pagelinks; skipping old links table updates
...il_from OK
...have rc_ip field in recentchanges table.
...index PRIMARY already set on image table.
...have rc_id field in recentchanges table.
...have rc_patrolled field in recentchanges table.
...logging table already exists.
...have user_token field in user table.
...have wl_notificationtimestamp field in watchlist table.
...watchlist talk page rows already present.
...user table does not contain user_emailauthenticationtimestamp field.
...page table already exists.
...have log_params field in logging table.
...logging table has correct log_title encoding.
...have ar_rev_id field in archive table.
...have page_len field in page table.
...revision table does not contain inverse_timestamp field.
...have rev_deleted field in revision table.
...have img_width field in image table.
...have img_metadata field in image table.
...have user_email_token field in user table.
...page_namespace is already a full int (int(11)).
...ar_namespace is already a full int (int(11)).
...rc_namespace is already a full int (int(11)).
...wl_namespace is already a full int (int(11)).
...qc_namespace is already a full int (int(11)).
...log_namespace is already a full int (int(11)).
...have img_media_type field in image table.
...already have pagelinks table.
...image table does not contain img_type field.
...already have unique user_name index.
...user_groups table exists and is in current format.
...have ss_total_pages field in site_stats table.
...user_newtalk table already exists.
...have iw_trans field in interwiki table.
...wl_notificationtimestamp is already nullable.
...index times already set on logging table.
...have ipb_range_start field in ipblocks table.
...no page_random rows needed to be set
...have user_registration field in user table.
...templatelinks table already exists
...externallinks table already exists.
...job table already exists.
...have ss_images field in site_stats table.
...langlinks table already exists.
...querycache_info table already exists.
...filearchive table already exists.
...have ipb_anon_only field in ipblocks table.
...have user_newpass_time field in user table.
...redirect table already exists.
...querycachetwo table already exists.
...have ipb_enable_autoblock field in ipblocks table.
...index pl_namespace on table pagelinks includes field pl_from.
...index tl_namespace on table templatelinks includes field tl_from.
...index il_to on table imagelinks includes field il_from.
...have rc_old_len field in recentchanges table.
...have user_editcount field in user table.
...page_restrictions table already exists.
...have log_id field in logging table.
...have rev_parent_id field in revision table.
...have pr_id field in page_restrictions table.
...have rev_len field in revision table.
...have rc_deleted field in recentchanges table.
...have log_deleted field in logging table.
...have ar_deleted field in archive table.
...have ipb_deleted field in ipblocks table.
...have fa_deleted field in filearchive table.
...have ar_len field in archive table.
...have ipb_block_email field in ipblocks table.
...index cl_sortkey on table categorylinks includes field cl_from.
...have oi_metadata field in oldimage table.
...have ar_page_id field in archive table.
...have img_sha1 field in image table.
...protected_titles table already exists.
...page_props table already exists.
...updatelog table already exists.
...category table already exists.
Populating category table, printing progress markers. For large databases, you
may want to hit Ctrl-C and do this manually with maintenance/
populateCategory.php.
Done populating category table.
...have ar_parent_id field in archive table.
...have user_last_timestamp field in user_newtalk table.
Populating rev_parent_id fields, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateParentId.php.
Populating rev_parent_id column
...doing rev_id from 1 to 200
rev_parent_id population complete ... 0 rows [0 changed]
...protected_titles table has correct pt_title encoding.
...have ss_active_users field in site_stats table.
...ss_active_users user count set...
...have ipb_allow_usertalk field in ipblocks table.
...change_tag table already exists.
...user_properties table already exists.
...log_search table already exists.
Populating log_search table, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateLogSearch.php.
Nothing to do.
done.
...l10n_cache table already exists.
...ct_rc_id key doesn't exist.
...have rd_interwiki field in redirect table.
Altering all *_mime_minor fields to 100 bytes in size ...done.
...iwlinks table already exists.
...index iwl_prefix_title_from already set on iwlinks table.
...have ul_value field in updatelog table.
...have iw_api field in interwiki table.
...iwl_prefix key doesn't exist.
...have cl_collation field in categorylinks table.
Updating categorylinks (again) ...done.
...module_deps table already exists.
...ar_page_revid key doesn't exist.
...skipping index ar_revid because index ar_revid already set on archive table.
...user_last_timestamp is already nullable.
...index user_email already set on user table.
...up_property in table user_properties already modified by patch patch-up_property.sql.
...uploadstash table already exists.
...user_former_groups table already exists.
...have rev_sha1 field in revision table.
...batch conversion of user_options: nothing to migrate. done.
...user table does not contain user_options field.
...have ar_sha1 field in archive table.
...index page_redirect_namespace_len already set on page table.
...have us_chunk_inx field in uploadstash table.
...have job_timestamp field in job table.
...index page_user_timestamp already set on revision table.
...have ipb_parent_block_id field in ipblocks table.
...index ipb_parent_block_id already set on ipblocks table.
...category table does not contain cat_hidden field.
...have rev_content_format field in revision table.
...have rev_content_model field in revision table.
...have ar_content_format field in archive table.
...have ar_content_model field in archive table.
...have page_content_model field in page table.
...site_stats table does not contain ss_admins field.
...recentchanges table does not contain rc_moved_to_title field.
...sites table already exists.
...have fa_sha1 field in filearchive table.
...have job_token field in job table.
...have job_attempts field in job table.
...have us_props field in uploadstash table.
...ug_group in table user_groups already modified by patch patch-ug_group-length-increase-255.sql.
...ufg_group in table user_former_groups already modified by patch patch-ufg_group-length-increase-255.sql.
...index pp_propname_page already set on page_props table.
...index img_media_mime already set on image table.
...iwl_prefix_title_from index is already non-UNIQUE.
...index iwl_prefix_from_title already set on iwlinks table.
...have ar_id field in archive table.
...have el_id field in externallinks table.
...have rc_source field in recentchanges table.
...have page_links_updated field in page table.
...have user_password_expires field in user table.
...have pp_sortkey field in page_props table.
...recentchanges table does not contain rc_cur_time field.
...index wl_user_notificationtimestamp already set on watchlist table.
...have page_lang field in page table.
...have pl_from_namespace field in pagelinks table.
...have tl_from_namespace field in templatelinks table.
...have il_from_namespace field in imagelinks table.
...img_major_mime in table image already modified by patch patch-img_major_mime-chemical.sql.
...oi_major_mime in table oldimage already modified by patch patch-oi_major_mime-chemical.sql.
...fa_major_mime in table filearchive already modified by patch patch-fa_major_mime-chemical.sql.
...comment fields are up to date.
...hitcounter doesn't exist.
...site_stats table does not contain ss_total_views field.
...page table does not contain page_counter field.
...msg_resource_links doesn't exist.
...msg_resource doesn't exist.
...bot_passwords table already exists.
...have wl_id field in watchlist table.
...cl_collation key doesn't exist.
...index cl_collation_ext already set on categorylinks table.
...collations up-to-date.
...index rc_name_type_patrolled_timestamp already set on recentchanges table.
...rev_page_id index already non-unique.
...pl_namespace, tl_namespace, il_to indices are already non-UNIQUE.
...have ct_id field in change_tag table.
Modifying rc_ip field of table recentchanges ...done.
...have el_index_60 field in externallinks table.
...ug_user_group key doesn't exist.
...have ug_expiry field in user_groups table.
Modifying img_media_type field of table image ...done.
...ip_changes table already exists.
...index PRIMARY already set on categorylinks table.
...index PRIMARY already set on templatelinks table.
...index PRIMARY already set on pagelinks table.
...index PRIMARY already set on text table.
...index PRIMARY already set on imagelinks table.
...index PRIMARY already set on iwlinks table.
...index PRIMARY already set on langlinks table.
...index PRIMARY already set on log_search table.
...index PRIMARY already set on module_deps table.
...index PRIMARY already set on objectcache table.
...index PRIMARY already set on querycache_info table.
...index PRIMARY already set on site_stats table.
...index PRIMARY already set on user_former_groups table.
...index PRIMARY already set on user_properties table.
...comment table already exists.
...revision_comment_temp table already exists.
...have ar_comment_id field in archive table.
...have fa_description_id field in filearchive table.
Modifying img_description field of table image ...done.
...have ipb_reason_id field in ipblocks table.
...have log_comment_id field in logging table.
...have oi_description_id field in oldimage table.
...have pt_reason_id field in protected_titles table.
...have rc_comment_id field in recentchanges table.
Modifying rev_comment field of table revision ...done.
...have img_description_id field in image table.
Migrating comments to the 'comments' table, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/migrateComments.php.
Beginning migration of revision.rev_comment to revision_comment_temp.revcomment_comment_id
... 1
Completed migration, updated 1 row(s) with 1 new comment(s)
Beginning migration of archive.ar_comment to archive.ar_comment_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of ipblocks.ipb_reason to ipblocks.ipb_reason_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of image.img_description to image.img_description_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of oldimage.oi_description to oldimage.oi_description_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of filearchive.fa_deleted_reason to filearchive.fa_deleted_reason_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of filearchive.fa_description to filearchive.fa_description_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of recentchanges.rc_comment to recentchanges.rc_comment_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of logging.log_comment to logging.log_comment_id
Completed migration, updated 0 row(s) with 0 new comment(s)
Beginning migration of protected_titles.pt_reason to protected_titles.pt_reason_id
Completed migration, updated 0 row(s) with 0 new comment(s)
done.
...index PRIMARY already set on l10n_cache table.
...bot_passwords.bp_user is already unsigned int.
...change_tag.ct_log_id is already unsigned int.
...change_tag.ct_rev_id is already unsigned int.
...page_restrictions.pr_user is already unsigned int.
...user_newtalk.user_id is already unsigned int.
...user_properties.up_user is already unsigned int.
...slots table already exists.
...have slot_origin field in slots table.
...content table already exists.
...slot_roles table already exists.
...content_models table already exists.
...actor table already exists.
...revision_actor_temp table already exists.
...have ar_actor field in archive table.
...have ipb_by_actor field in ipblocks table.
...have img_actor field in image table.
...have oi_actor field in oldimage table.
...have fa_actor field in filearchive table.
...have rc_actor field in recentchanges table.
...have log_actor field in logging table.
Migrating actors to the 'actor' table, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/migrateActors.php.
Creating actor entries for all registered users
... 1 - 1
Completed actor creation, added 1 new actor(s)
Beginning migration of revision.rev_user and revision.rev_user_text to revision_actor_temp.revactor_actor
... rev_id=1
Completed migration, updated 1 row(s) with 1 new actor(s), 0 error(s)
Beginning migration of archive.ar_user and archive.ar_user_text to archive.ar_actor
Completed migration, updated 0 row(s) with 0 new actor(s), 0 error(s)
Beginning migration of ipblocks.ipb_by and ipblocks.ipb_by_text to ipblocks.ipb_by_actor
Completed migration, updated 0 row(s) with 0 new actor(s), 0 error(s)
Beginning migration of image.img_user and image.img_user_text to image.img_actor
Completed migration, updated 0 row(s) with 0 new actor(s), 0 error(s)
Beginning migration of oldimage.oi_user and oldimage.oi_user_text to oldimage.oi_actor
Completed migration, updated 0 row(s) with 0 new actor(s), 0 error(s)
Beginning migration of filearchive.fa_user and filearchive.fa_user_text to filearchive.fa_actor
Completed migration, updated 0 row(s) with 0 new actor(s), 0 error(s)
Beginning migration of recentchanges.rc_user and recentchanges.rc_user_text to recentchanges.rc_actor
Completed migration, updated 0 row(s) with 0 new actor(s), 0 error(s)
Beginning migration of logging.log_user and logging.log_user_text to logging.log_actor
Completed migration, updated 0 row(s) with 0 new actor(s), 0 error(s)
Beginning migration of log_search
Completed migration, inserted 0 row(s) with 0 new actor(s), 0 error(s)
done.
Modifying rev_text_id field of table revision ...done.
Modifying table site_stats ...done.
...index rc_namespace_title_timestamp already set on recentchanges table.
Creating change_tag_def table ...done.
Populating el_index_60 field, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateExternallinksIndex60.php.
Populating externallinks.el_index_60...
el_id 0 - 200 of 
Done, 0 rows updated.
done.
Modifying el_index_60 field of table externallinks ...done.
Running maintenance/deduplicateArchiveRevId.php...
Deduplicating ar_rev_id...
New install, nothing to do here.
done.
Adding ct_tag_id field to table change_tag ...done.
Adding index ar_revid_uniq to table archive ...done.
Migrating revision data to the MCR 'slot' and 'content' tables, printing progress markers.
For large databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateContentTables.php.
Populating revision...
... revision processed up to revision id 1 of 1 (1 rows in 0.011377096176147 seconds)
Done populating revision table. Processed 1 rows in 0.01144814491272 seconds
Populating archive...
Done populating archive table. Processed 0 rows in 0.00087499618530273 seconds
Done. Processed 1 rows in 0.019545078277588 seconds
done.
Adding index log_type_action to table logging ...done.
Dropping type_action index from table logging ...done.
Renaming index iw_prefix into PRIMARY to table interwiki ...done.
Renaming index pp_page_propname into PRIMARY to table page_props ...done.
Renaming index pt_namespace_title into PRIMARY to table protected_titles ...done.
Renaming index site_ids_type into PRIMARY to table site_identifiers ...done.
Adding index rc_this_oldid to table recentchanges ...done.
Dropping table transcache ...done.
Running maintenance/populateChangeTagDef.php...
No user defined tags to set, moving on...
done.
Adding index change_tag_rc_tag_id to table change_tag ...done.
Adding ipb_sitewide field to table ipblocks ...done.
Creating ipblocks_restrictions table ...done.
Merging image_comment_temp into the image table
Merging image_comment_temp into the image table...
Completed merge of image_comment_temp into the image table, 0 image rows updated, 0 image_comment_temp rows deleted.
done.
Dropping table image_comment_temp ...done.
Table change_tag contains ct_tag field. Dropping ...done.
Dropping table valid_tag ...done.
Dropping table tag_summary ...done.
Table archive contains ar_comment field. Dropping ...done.
Table ipblocks contains ipb_reason field. Dropping ...done.
Table image contains img_description field. Dropping ...done.
Table oldimage contains oi_description field. Dropping ...done.
Table filearchive contains fa_description field. Dropping ...done.
Table recentchanges contains rc_comment field. Dropping ...done.
Table logging contains log_comment field. Dropping ...done.
Table protected_titles contains pt_reason field. Dropping ...done.
Modifying table job ...done.
Dropping ar_usertext_timestamp index from table archive ...done.
...usertext_timestamp key doesn't exist.
Table archive contains ar_user field. Dropping ...done.
...ipblocks table does not contain ip_by field.
Dropping img_user_timestamp index from table image ...done.
Table image contains img_user field. Dropping ...done.
Table oldimage contains oi_user field. Dropping ...done.
Table filearchive contains fa_user field. Dropping ...done.
Table recentchanges contains rc_user field. Dropping ...done.
Table logging contains log_user field. Dropping ...done.
...index un_user_ip already set on user_newtalk table.
Creating watchlist_expiry table ...done.
Modifying page_restrictions field of table page ...done.
Renaming index ipb_address into ipb_address_unique to table ipblocks ...done.
Adding rev_actor field to table revision ...done.
Table archive contains ar_text_id field. Dropping ...done.
Updating length of lc_lang in `w_l10n_cache` ...done.
Updating length of ll_lang in `w_langlinks` ...done.
Updating length of site_language in `w_sites` ...done.
...index ipb_address_unique on table ipblocks has no field ipb_anon_only; added.
...ipb_address_unique index up-to-date.
Modifying actor_name field of table actor ...done.
Modifying site_global_key field of table sites ...done.
Modifying iwl_prefix field of table iwlinks ...done.
...oathauth_users table already exists.
...oathauth_users table does not contain secret_reset field.
Adding module field to table oathauth_users ...done.
Table oathauth_users contains secret field. Dropping ...done.
...site_stats is populated...done.
Checking existence of old default messages...done.
Populating rev_len column
...doing rev_id from 1 to 200
Populating ar_len column
...archive table seems to be empty.
rev_len and ar_len population complete [0 revision rows, 0 archive rows].
Populating rev_sha1 column
...doing rev_id from 1 to 200
Populating ar_sha1 column
...archive table seems to be empty.
Populating ar_sha1 column legacy rows
rev_sha1 and ar_sha1 population complete [0 revision rows, 0 archive rows].
Populating img_sha1 field

Done 0 files in 0.0 seconds
Fixing protocol-relative entries in the externallinks table...
Done, 0 rows updated.
Populating fa_sha1 field from fa_storage_key

Done 0 files in 0.0 seconds
Updating *_from_namespace fields in links tables.
...doing page_id from 1 to 200
Adding empty categories with description pages...
Removing empty categories without description pages...
Category cleanup complete.
Populating page_props.pp_sortkey...
Populating page_props.pp_sortkey complete.
Updated a total of 0 rows
Copying IP revisions to ip_changes, from rev_id 0 to rev_id 1
...checking 1 revisions for IP edits that need copying, between rev_ids 0 and 1
Attempted to insert 0 IP revisions, 0 actually done.
Updating externallinks table index fields
Done, 0 rows updated, 0 deleted.
Purging caches...done.

Done in 3.0 s.
study@study-VirtualBox:/var/www/html/w$ 

 

 

LocalSettings.php 수정

study@study-VirtualBox:/var/www/html/w$ sudo nano LocalSettings.php

1.31에는 없던 익스텐션이 1.35에는 새로 6개가 추가되었으므로 해당 익스텐션을 읽어들이는 구문을 추가해줍니다.

wfLoadExtension( 'PageImages' );
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'VisualEditor' );

 

이것으로 미디어위키 버전 업그레이드 끝입니다.


 

미디어위키도 사람이 그것도 여러 사람들이 협업하여 개발하는 프로그램이다보니 버그가 있을 수 있습니다. 그리고 어떤 버그들은 치명적일 수 있습니다. 이럴 때는 어쩔 수 없이 기존 버전으로 원상복구를 해야합니다.

아래의 글은 그것을 위한 설명들입니다.

 

이전 버전 DB로 교체

미디어위키 현재 상태(상위 버전)의 DB 백업

study@study-VirtualBox:~$ mysqldump -h localhost -u root -p --default-character-set=binary my_wiki > backup_mw1.35.sql
Enter password: 
study@study-VirtualBox:~$

 

study@study-VirtualBox:~$ ls -l | grep sql
-rw-rw-r-- 1 study study 2349073  5월  1 23:13 backup_mw1.31.sql
-rw-rw-r-- 1 study study 2831100  5월  2 10:45 backup_mw1.35.sql
study@study-VirtualBox:~$

보면 1.31 버전일 때의 DB와 1.35 버전일 때 DB가 같이 존재하게 된 것을 볼 수 있습니다.

 

현재 DB 삭제(Drop)

study@study-VirtualBox:~$ mysqladmin -u root -p drop my_wiki
Enter password: 
Dropping the database is potentially a very bad thing to do.
Any data stored in the database will be destroyed.

Do you really want to drop the 'my_wiki' database [y/N] y
Database "my_wiki" dropped
study@study-VirtualBox:~$ 

DB를 백업했으니 이제 현재 미디어위키 DB를 삭제해줍니다.

DB 등을 삭제하는 행위를 드롭(Drop)이라고 합니다.

 

study@study-VirtualBox:~$ sudo mysql
[sudo] study의 암호: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 62
Server version: 10.5.9-MariaDB-1:10.5.9+maria~focal mariadb.org binary distribution

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 databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| phpmyadmin         |
+--------------------+
4 rows in set (0.031 sec)

MariaDB [(none)]> exit;
Bye
study@study-VirtualBox:~$ 

미디어위키 DB가 정상적으로 삭제되었는지는 위 과정을 통해 확인할 수 있습니다.

 

동일한 이름의 DB 생성

study@study-VirtualBox:~$ mysqladmin -u root -p create my_wiki
Enter password: 
study@study-VirtualBox:~$

아까 제거했던 DB과 동일한 이름의 DB를 다시 생성해줍니다.

 

study@study-VirtualBox:~$ sudo mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 64
Server version: 10.5.9-MariaDB-1:10.5.9+maria~focal mariadb.org binary distribution

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 databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| my_wiki            |
| mysql              |
| performance_schema |
| phpmyadmin         |
+--------------------+
5 rows in set (0.000 sec)

MariaDB [(none)]> exit;
Bye
study@study-VirtualBox:~$ 

DB가 다시 생긴 것을 확인할 수 있습니다.

 

이전버전 DB 삽입(Import)

study@study-VirtualBox:~$ mysql -u root -p my_wiki < backup_mw1.31.sql
Enter password: 
study@study-VirtualBox:~$ 

이제 이전 버전의 DB 백업 파일을 미디어위키 DB에 삽입(Import)해줍니다.

 

새로 추가되었던 스킨과 익스텐션 디렉터리 삭제

study@study-VirtualBox:/var/www/html/w/extensions$ sudo rm -rf PageImages Scribunto SecureLinkFixer TemplateData TextExtracts VisualEditor
[sudo] study의 암호: 
study@study-VirtualBox:/var/www/html/w/extensions$ ls -F
CategoryTree/  ImageMap/            OATHAuth/         ReplaceText/
Cite/          InputBox/            ParserFunctions/  SpamBlacklist/
CiteThisPage/  Interwiki/           PdfHandler/       SyntaxHighlight_GeSHi/
CodeEditor/    LocalisationUpdate/  Poem/             TitleBlacklist/
ConfirmEdit/   MultimediaViewer/    README            WikiEditor/
Gadgets/       Nuke/                Renameuser/
study@study-VirtualBox:/var/www/html/w/extensions$ 

1.35 버전은 1.31 버전에 비해 6개의 새로운 익스텐션이 추가되었습니다. 해당 익스텐션의 디렉터리를 제거해줍니다.

리눅스 등 유닉스 계열 OS는 파일이나 디렉터리 등의 이름에 대소문자를 구분합니다.

따라서 각 익스텐션의 디렉터리명을 정확하게 지정해주어야 합니다.

 

study@study-VirtualBox:~$ cd /var/www/html/w
study@study-VirtualBox:/var/www/html/w$ sudo git checkout 1.31.14
warning: unable to rmdir 'extensions/PageImages': 디렉터리가 비어있지 않음
warning: unable to rmdir 'extensions/Scribunto': 디렉터리가 비어있지 않음
warning: unable to rmdir 'extensions/SecureLinkFixer': 디렉터리가 비어있지 않음
warning: unable to rmdir 'extensions/TemplateData': 디렉터리가 비어있지 않음
warning: unable to rmdir 'extensions/TextExtracts': 디렉터리가 비어있지 않음
warning: unable to rmdir 'extensions/VisualEditor': 디렉터리가 비어있지 않음

- 하략 -

만약 해당 추가 익스텐션의 디렉터리를 제거하지 않고 브랜치 전환(체크아웃)을 하면 위와 같은 오류 메시지다 출력됩니다.

 

미디어위키 이전 버전 브랜치로 전환

study@study-VirtualBox:/var/www/html/w$ sudo git checkout 1.31.14
파일을 갱신합니다: 100% (10335/10335), 완료.
M	extensions/CategoryTree
M	extensions/Cite
M	extensions/CiteThisPage
M	extensions/CodeEditor
M	extensions/ConfirmEdit
M	extensions/Gadgets
M	extensions/ImageMap
M	extensions/InputBox
M	extensions/Interwiki
M	extensions/LocalisationUpdate
M	extensions/MultimediaViewer
M	extensions/Nuke
M	extensions/OATHAuth
M	extensions/ParserFunctions
M	extensions/PdfHandler
M	extensions/Poem
M	extensions/Renameuser
M	extensions/ReplaceText
M	extensions/SpamBlacklist
M	extensions/SyntaxHighlight_GeSHi
M	extensions/TitleBlacklist
M	extensions/WikiEditor
M	skins/MonoBook
M	skins/Timeless
M	skins/Vector
M	vendor
이전 HEAD 위치는 e5823c068a Prep 1.35.2
HEAD의 현재 위치는 94cbdfbc50 Prep 1.31.14
study@study-VirtualBox:/var/www/html/w$ 

미디어위키 Core의 브랜치가 기존 1.35.2에서 1.31.14로 변경됩니다.

 

하위모듈 업데이트

study@study-VirtualBox:/var/www/html/w$ sudo git submodule update --init --recursive
하위 모듈 경로 'extensions/CategoryTree': '6933f5bb647ef22b78d813fa944debb01fc16c2b' 체크아웃
하위 모듈 경로 'extensions/Cite': 'db249bae3d2c87f5a98082ddbd96a619d35bea75' 체크아웃
하위 모듈 경로 'extensions/CiteThisPage': '1b8edf2b51d2cf8babe7cbeb5c6fe2b6098c7be1' 체크아웃
하위 모듈 경로 'extensions/CodeEditor': '4203f2bbd5b7521b2274ca3068a03d052f4afb93' 체크아웃
하위 모듈 경로 'extensions/ConfirmEdit': '65f34763f326a912622af9eddcca574c78c02fa9' 체크아웃
하위 모듈 경로 'extensions/Gadgets': '7ab92a1c89f17b235dc8b96bacb95a49e117ed5b' 체크아웃
하위 모듈 경로 'extensions/ImageMap': '4a45ba4a3bfd29c3ffbcaff8ac639941dc670969' 체크아웃
하위 모듈 경로 'extensions/InputBox': '2ab0a1405878e9c81591d976e034eca0bd900305' 체크아웃
하위 모듈 경로 'extensions/Interwiki': '718e96a3db73fd6939c1a1186c01132efe807e79' 체크아웃
하위 모듈 경로 'extensions/LocalisationUpdate': 'ac299fe1df86742619a6b44310f39724e82d394f' 체크아웃
하위 모듈 경로 'extensions/MultimediaViewer': '697136234aa78cca0cadee2f10410d99f7387d17' 체크아웃
하위 모듈 경로 'extensions/Nuke': '5147db3e50f3f0dd6d2e611c6b4dff597a8ab10e' 체크아웃
하위 모듈 경로 'extensions/OATHAuth': 'b11fea365909c289f5929a2e961359ae10c67016' 체크아웃
하위 모듈 경로 'extensions/ParserFunctions': '9541d8907b5f804c2960e100d7b29ec9945fdc82' 체크아웃
하위 모듈 경로 'extensions/PdfHandler': '491f057637543c463c3196ee3049de9521b9a56d' 체크아웃
하위 모듈 경로 'extensions/Poem': '48f4b1d8f2a947beaf76dc90517a88bd55cecbba' 체크아웃
하위 모듈 경로 'extensions/Renameuser': 'e92f315a4f0744ee86fbb3aa72e6f855f72ba6df' 체크아웃
하위 모듈 경로 'extensions/ReplaceText': 'be197b8c577450fc2b9fa8e09acdcc511ef81a27' 체크아웃
하위 모듈 경로 'extensions/SpamBlacklist': '793c8f155ae2d411b43dc75670078bcfe6e76513' 체크아웃
하위 모듈 경로 'extensions/SyntaxHighlight_GeSHi': 'f0dca73bebddd4640a8582425385cd5aac4cc83e' 체크아웃
하위 모듈 경로 'extensions/TitleBlacklist': 'a3124b6829ae216148ab52f5900d8beb2f2407f6' 체크아웃
하위 모듈 경로 'extensions/WikiEditor': 'b5647a7d7c4b47f8da3f9614f3fd295dd20f5a12' 체크아웃
하위 모듈 경로 'skins/MonoBook': 'c3f80c402b2aefb7b0f32e101fdbc36537d5e147' 체크아웃
하위 모듈 경로 'skins/Timeless': 'f90234655a470aa1100b49a88ac89d403e487320' 체크아웃
하위 모듈 경로 'skins/Vector': '06292be20054ccef4cb3f1a6fb5152ad55d11b47' 체크아웃
하위 모듈 경로 'vendor': '1521f359a06aed626e860285769ed78a7152cdec' 체크아웃
study@study-VirtualBox:/var/www/html/w$ 

이제 변경된 Core 버전에 맞춰 하위모듈들도 적용 브랜치를 전환해줍니다.

 

LocalSettings.php 파일 수정

study@study-VirtualBox:/var/www/html/w$ sudo nano LocalSettings.php

 

# wfLoadExtension( 'PageImages' );
# wfLoadExtension( 'Scribunto' );
# wfLoadExtension( 'SecureLinkFixer' );
# wfLoadExtension( 'TemplateData' );
# wfLoadExtension( 'TextExtracts' );
# wfLoadExtension( 'VisualEditor' );

추가되었던 익스텐션 로드 구문을 주석처리해줍니다.

 

미디어위키 DB 업데이트

study@study-VirtualBox:/var/www/html/w$ sudo php maintenance/update.php
MediaWiki 1.31.14 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for my_wiki-w_
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0
Turning off Content Handler DB fields for this part of upgrade.

- 중략 -

Copying IP revisions to ip_changes, from rev_id 0 to rev_id 1
...checking 1 revisions for IP edits that need copying, between rev_ids 0 and 1
Attempted to insert 0 IP revisions, 0 actually done.
Purging caches...done.

Done in 0.6 s.
study@study-VirtualBox:/var/www/html/w$ 

이 작업은 사실 아까 1.31. 버전용 DB로 임포트했으므로 해줄 필요 없습니다.

 

더보기

미디어위키 DB 업데이트 진행과정

study@study-VirtualBox:/var/www/html/w$ sudo php maintenance/update.php
MediaWiki 1.31.14 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for my_wiki-w_
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0
Turning off Content Handler DB fields for this part of upgrade.
...have ipb_id field in ipblocks table.
...have ipb_expiry field in ipblocks table.
...already have interwiki table
...indexes seem up to 20031107 standards.
...have rc_type field in recentchanges table.
...index new_name_timestamp already set on recentchanges table.
...have user_real_name field in user table.
...querycache table already exists.
...objectcache table already exists.
...categorylinks table already exists.
...have pagelinks; skipping old links table updates
...il_from OK
...have rc_ip field in recentchanges table.
...index PRIMARY already set on image table.
...have rc_id field in recentchanges table.
...have rc_patrolled field in recentchanges table.
...logging table already exists.
...have user_token field in user table.
...have wl_notificationtimestamp field in watchlist table.
...watchlist talk page rows already present.
...user table does not contain user_emailauthenticationtimestamp field.
...page table already exists.
...have log_params field in logging table.
...logging table has correct log_title encoding.
...have ar_rev_id field in archive table.
...have page_len field in page table.
...revision table does not contain inverse_timestamp field.
...have rev_text_id field in revision table.
...have rev_deleted field in revision table.
...have img_width field in image table.
...have img_metadata field in image table.
...have user_email_token field in user table.
...have ar_text_id field in archive table.
...page_namespace is already a full int (int(11)).
...ar_namespace is already a full int (int(11)).
...rc_namespace is already a full int (int(11)).
...wl_namespace is already a full int (int(11)).
...qc_namespace is already a full int (int(11)).
...log_namespace is already a full int (int(11)).
...have img_media_type field in image table.
...already have pagelinks table.
...image table does not contain img_type field.
...already have unique user_name index.
...user_groups table exists and is in current format.
...have ss_total_pages field in site_stats table.
...user_newtalk table already exists.
...transcache table already exists.
...have iw_trans field in interwiki table.
...wl_notificationtimestamp is already nullable.
...index times already set on logging table.
...have ipb_range_start field in ipblocks table.
...no page_random rows needed to be set
...have user_registration field in user table.
...templatelinks table already exists
...externallinks table already exists.
...job table already exists.
...have ss_images field in site_stats table.
...langlinks table already exists.
...querycache_info table already exists.
...filearchive table already exists.
...have ipb_anon_only field in ipblocks table.
...index rc_ns_usertext already set on recentchanges table.
...index rc_user_text already set on recentchanges table.
...have user_newpass_time field in user table.
...redirect table already exists.
...querycachetwo table already exists.
...have ipb_enable_autoblock field in ipblocks table.
...index pl_namespace on table pagelinks includes field pl_from.
...index tl_namespace on table templatelinks includes field tl_from.
...index il_to on table imagelinks includes field il_from.
...have rc_old_len field in recentchanges table.
...have user_editcount field in user table.
...page_restrictions table already exists.
...have log_id field in logging table.
...have rev_parent_id field in revision table.
...have pr_id field in page_restrictions table.
...have rev_len field in revision table.
...have rc_deleted field in recentchanges table.
...have log_deleted field in logging table.
...have ar_deleted field in archive table.
...have ipb_deleted field in ipblocks table.
...have fa_deleted field in filearchive table.
...have ar_len field in archive table.
...have ipb_block_email field in ipblocks table.
...index cl_sortkey on table categorylinks includes field cl_from.
...have oi_metadata field in oldimage table.
Adding index usertext_timestamp to table archive ...done.
...index img_usertext_timestamp already set on image table.
...index oi_usertext_timestamp already set on oldimage table.
...have ar_page_id field in archive table.
...have img_sha1 field in image table.
...protected_titles table already exists.
...have ipb_by_text field in ipblocks table.
...page_props table already exists.
...updatelog table already exists.
...category table already exists.
Populating category table, printing progress markers. For large databases, you
may want to hit Ctrl-C and do this manually with maintenance/
populateCategory.php.
Category population complete.
Done populating category table.
...have ar_parent_id field in archive table.
...have user_last_timestamp field in user_newtalk table.
Populating rev_parent_id fields, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateParentId.php.
Populating rev_parent_id column
...doing rev_id from 1 to 200
rev_parent_id population complete ... 0 rows [0 changed]
...protected_titles table has correct pt_title encoding.
...have ss_active_users field in site_stats table.
...ss_active_users user count set...
...have ipb_allow_usertalk field in ipblocks table.
...change_tag table already exists.
...tag_summary table already exists.
...valid_tag table already exists.
...user_properties table already exists.
...log_search table already exists.
...have log_user_text field in logging table.
Populating log_user_text field, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateLogUsertext.php.
Nothing to do.
done.
Populating log_search table, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateLogSearch.php.
Nothing to do.
done.
...l10n_cache table already exists.
...index change_tag_rc_tag already set on change_tag table.
...have rd_interwiki field in redirect table.
Converting tc_time from UNIX epoch to MediaWiki timestamp ...done.
Altering all *_mime_minor fields to 100 bytes in size ...done.
...iwlinks table already exists.
...index iwl_prefix_title_from already set on iwlinks table.
...have ul_value field in updatelog table.
...have iw_api field in interwiki table.
...iwl_prefix key doesn't exist.
...have cl_collation field in categorylinks table.
Updating categorylinks (again) ...done.
...module_deps table already exists.
...ar_page_revid key doesn't exist.
...index ar_revid already set on archive table.
...ll_lang is up-to-date.
...user_last_timestamp is already nullable.
...index user_email already set on user table.
...up_property in table user_properties already modified by patch patch-up_property.sql.
...uploadstash table already exists.
...user_former_groups table already exists.
...index type_action already set on logging table.
...have rev_sha1 field in revision table.
...batch conversion of user_options: nothing to migrate. done.
...user table does not contain user_options field.
...have ar_sha1 field in archive table.
...index page_redirect_namespace_len already set on page table.
...have us_chunk_inx field in uploadstash table.
...have job_timestamp field in job table.
...index page_user_timestamp already set on revision table.
...have ipb_parent_block_id field in ipblocks table.
...index ipb_parent_block_id already set on ipblocks table.
...category table does not contain cat_hidden field.
...have rev_content_format field in revision table.
...have rev_content_model field in revision table.
...have ar_content_format field in archive table.
...have ar_content_model field in archive table.
...have page_content_model field in page table.
Content Handler DB fields should be usable now.
...site_stats table does not contain ss_admins field.
...recentchanges table does not contain rc_moved_to_title field.
...sites table already exists.
...have fa_sha1 field in filearchive table.
...have job_token field in job table.
...have job_attempts field in job table.
...have us_props field in uploadstash table.
...ug_group in table user_groups already modified by patch patch-ug_group-length-increase-255.sql.
...ufg_group in table user_former_groups already modified by patch patch-ufg_group-length-increase-255.sql.
...index pp_propname_page already set on page_props table.
...index img_media_mime already set on image table.
...iwl_prefix_title_from index is already non-UNIQUE.
...index iwl_prefix_from_title already set on iwlinks table.
...have ar_id field in archive table.
...have el_id field in externallinks table.
...have rc_source field in recentchanges table.
...index log_user_text_type_time already set on logging table.
...index log_user_text_time already set on logging table.
...have page_links_updated field in page table.
...have user_password_expires field in user table.
...have pp_sortkey field in page_props table.
...recentchanges table does not contain rc_cur_time field.
...index wl_user_notificationtimestamp already set on watchlist table.
...have page_lang field in page table.
...have pl_from_namespace field in pagelinks table.
...have tl_from_namespace field in templatelinks table.
...have il_from_namespace field in imagelinks table.
...img_major_mime in table image already modified by patch patch-img_major_mime-chemical.sql.
...oi_major_mime in table oldimage already modified by patch patch-oi_major_mime-chemical.sql.
...fa_major_mime in table filearchive already modified by patch patch-fa_major_mime-chemical.sql.
...comment fields are up to date...hitcounter doesn't exist.
...site_stats table does not contain ss_total_views field.
...page table does not contain page_counter field.
...msg_resource_links doesn't exist.
...msg_resource doesn't exist.
...bot_passwords table already exists.
...have wl_id field in watchlist table.
...cl_collation key doesn't exist.
...index cl_collation_ext already set on categorylinks table.
...collations up-to-date.
...index rc_name_type_patrolled_timestamp already set on recentchanges table.
...rev_page_id index already non-unique.
...pl_namespace, tl_namespace, il_to indices are already non-UNIQUE.
...have ct_id field in change_tag table.
...have ts_id field in tag_summary table.
Modifying rc_ip field of table recentchanges ...done.
...index usertext_timestamp already set on archive table.
...have el_index_60 field in externallinks table.
...ug_user_group key doesn't exist.
...have ug_expiry field in user_groups table.
...index img_user_timestamp already set on image table.
Modifying img_media_type field of table image ...done.
...ip_changes table already exists.
...index PRIMARY already set on categorylinks table.
...index PRIMARY already set on templatelinks table.
...index PRIMARY already set on pagelinks table.
...index PRIMARY already set on text table.
...index PRIMARY already set on imagelinks table.
...index PRIMARY already set on iwlinks table.
...index PRIMARY already set on langlinks table.
...index PRIMARY already set on log_search table.
...index PRIMARY already set on module_deps table.
...index PRIMARY already set on objectcache table.
...index PRIMARY already set on querycache_info table.
...index PRIMARY already set on site_stats table.
...index PRIMARY already set on transcache table.
...index PRIMARY already set on user_former_groups table.
...index PRIMARY already set on user_properties table.
...comment table already exists.
...revision_comment_temp table already exists.
...image_comment_temp table already exists.
...have ar_comment_id field in archive table.
...have fa_description_id field in filearchive table.
Modifying img_description field of table image ...done.
...have ipb_reason_id field in ipblocks table.
...have log_comment_id field in logging table.
...have oi_description_id field in oldimage table.
...have pt_reason_id field in protected_titles table.
...have rc_comment_id field in recentchanges table.
Modifying rev_comment field of table revision ...done.
...have img_description_id field in image table.
...index PRIMARY already set on l10n_cache table.
...bot_passwords.bp_user is already unsigned int.
...change_tag.ct_log_id is already unsigned int.
...change_tag.ct_rev_id is already unsigned int.
...page_restrictions.pr_user is already unsigned int.
...tag_summary.ts_log_id is already unsigned int.
...tag_summary.ts_rev_id is already unsigned int.
...user_newtalk.user_id is already unsigned int.
...user_properties.up_user is already unsigned int.
...slots table already exists.
...have slot_origin field in slots table.
...content table already exists.
...slot_roles table already exists.
...content_models table already exists.
...actor table already exists.
...revision_actor_temp table already exists.
...have ar_actor field in archive table.
...have ipb_by_actor field in ipblocks table.
...have img_actor field in image table.
...have oi_actor field in oldimage table.
...have fa_actor field in filearchive table.
...have rc_actor field in recentchanges table.
...have log_actor field in logging table.
Modifying rev_text_id field of table revision ...done.
Modifying table site_stats ...done.
...index rc_namespace_title_timestamp already set on recentchanges table.
...oathauth_users table already exists.
...oathauth_users table does not contain secret_reset field.
...site_stats is populated...done.
Checking existence of old default messages...done.
Populating rev_len column
...doing rev_id from 1 to 200
Populating ar_len column
...archive table seems to be empty.
rev_len and ar_len population complete [0 revision rows, 0 archive rows].
Populating rev_sha1 column
...doing rev_id from 1 to 200
Populating ar_sha1 column
...archive table seems to be empty.
Populating ar_sha1 column legacy rows
rev_sha1 and ar_sha1 population complete [0 revision rows, 0 archive rows].
Populating img_sha1 field

Done 0 files in 0.0 seconds
Fixing protocol-relative entries in the externallinks table...
Done, 0 rows updated.
Populating fa_sha1 field from fa_storage_key

Done 0 files in 0.0 seconds
Updating *_from_namespace fields in links tables.
...doing page_id from 1 to 200
Adding empty categories with description pages...
Removing empty categories without description pages...
Category cleanup complete.
Populating page_props.pp_sortkey...
Populating page_props.pp_sortkey complete.
Copying IP revisions to ip_changes, from rev_id 0 to rev_id 1
...checking 1 revisions for IP edits that need copying, between rev_ids 0 and 1
Attempted to insert 0 IP revisions, 0 actually done.
Purging caches...done.

Done in 0.6 s.
study@study-VirtualBox:/var/www/html/w$ 

 

 

이것으로 Git을 이용한 미디어위키 설치와 업그레이드 그리고 이전 버전으로 복구(다운그레이드) 과정 일체를 ㅇ라아보았습니다.

 

미력한 제 글이 다른 분들께 조금이나마 도움이 되었으면 좋겠습니다.