Bitbucket Server 설치 후 데이터베이스 타입을 변경해야 할 경우 참고하시기 바랍니다.
- postgresql 에서 MySQL 전환 예제
Procut | Version |
Bitbucket Server | 5.9.1 |
Postgresql | 9.3.22 |
MySQL | 5.7.22 |
※ Postgresql 에서 MySQL로 변환하기
1.MySQL 서버에 Database 생성 및 권한 설정
CREATE DATABASE bitbucketmig CHARACTER SET utf8 COLLATE utf8_bin; GRANT ALL PRIVILEGES ON bitbucketmig.* TO 'gituser'@'192.168.10.%' IDENTIFIED BY 'Agitpass12#$
2.기존 bitbucket-home 폴더 백업
1)bitbucket 서비스 중지
[atlassian@localhost bin]$ ./stop-bitbucket.sh
2)home폴더 압축하여 백업
[atlassian@localhost application-data]$ tar cvf bitbucket-home-postgre.tar bitbucket-home-postgre
3.MySQL Connector 라이브러리 저장
-home폴더에 존재하는 lib폴더에 connector 저장
[atlassian@localhost lib]$ pwd /app/atlassian/application-data/bitbucket-home-postgre/lib [atlassian@localhost lib]$ ls mysql-connector-java-5.1.45-bin.jar native
4.bitbucket 서비스 재시작
[atlassian@localhost bin]$ ./start-bitbucket.sh
5.마이그레이션 실행
bitbucket 로그인 -> 기어아이콘 클릭 : Database 클릭 -> Migrate database 실행
1)Database 확인 | 2)MySQL 정보 입력 -> TEST -> Start migration |
3)마이그레이션 결과 확인 | |
database 설정 정보 확인 [atlassian@localhost shared]$ pwd /app/atlassian/application-data/bitbucket-home-postgre/shared [atlassian@localhost shared]$ vi bitbucket.properties #>******************************************************* #> Migrated to database at jdbc:mysql://192.168.10.1:3306/bitbucketmig?characterEncoding=utf8&useUnicode=true #> Updated by admin on 2018-11-07T22:54:34.999+09:00 #>******************************************************* jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://192.168.10.1:3306/bitbucketmig?characterEncoding=utf8&useUnicode=true jdbc.user=gituser jdbc.password=Agitpass12#$ # jdbc.driver=org.postgresql.Driver # jdbc.url=jdbc:postgresql://192.168.10.1:5432/bitbucketdb # jdbc.user=gituser # jdbc.password=gitpass |