4번독수리의 둥지

SVN repository location 변경한 썰 본문

Machine

SVN repository location 변경한 썰

4번독수리 2015. 5. 12. 11:41

상황

  • svn에 trunk, test branch, release branch가 있음
  • 개발서버의 repository 디렉토리에 trunk, test, release 디렉토리, 테스트 서버에는 test 디렉토리, 실서버에는 release 디렉토리가 checkout되어 있는 상황.
  • 각 체크아웃 위치를 별도의 디렉토리에서 심볼릭 링크를 따서 소스에서는 심볼릭 링크를 참조함.
  • 운영은 로컬 개발이 완료되면 trunk에 commit, test branch에 commit 후 test 서버에서 test branch를 update, 검수 통과시 release branch에 commit, 실서버에서 release branch를 update하는 식으로 운영
  • 서버 운영 이슈로 기존 svn 서버가 운영종료되고 새 svn 서버로 repository location을 옮겨야 함. 새 svn 서버는 yobi를 사용중

 

1. 새 svn서버에 svn repository 생성 (yobi 프로젝트 생성)

 

2. 기존 저장소 디렉토리(repository) 옆에 새로 만든 프로젝트를 checkout 받는다.

svn co http://new-repository.net/svn/id/projectname --username rnd04

--> Checked out revision 0.

--> 새 저장소 디렉토리(projectname)가 생성됨

 

3. 기존 svn의 release branch를 새 svn의 trunk로 다시 commit한다

svn export repository/release projectname/trunk

--> Export complete.

svn add projectname/*

--> 푸슝푸슝

svn ci

--> 한번에 했더니 에러 발생 502 proxy error?

svn ci projectname/trunk -N (디렉토리가 먼저 commit되지 않으면 에러 발생 - svn: 'repository/trunk' is not under version control and is not part of the commit, yet its child '...' is part of the commit)

svn ci */* -N을 반복...

--> svn ci */*/*/*/*/*/*/*/*/*/*/*/* -N 까지 갔다 이건 뭐..

 

4. svn 서버에서 test branch 분기

projectname/branches 디렉토리를 만들어 svn add, ci

svn cp http://new-repository.net/svn/id/projectname/trunk http://new-repository.net/svn/id/projectname/branches

svn rename http://new-repository.net/svn/id/projectname/branches/trunk http://new-repository.net/svn/id/projectname/branches/test

svn up branches

 

5. svn 서버에서 release branch 분기

4와 동일

 

6. 기존 저장소 디렉토리(repository)에서 새 저장소 디렉토리(projectname)로 symlink 변경

ln -s projectname/trunk newlinkname

mv -T newlinkname oldlinkname

test branch, release branch도 동일하게 처리해준다.

 

7. 기존 저장소 디렉토리(repository) working copy를 새 저장소 디렉토리(projectname)에 merge

svn export repository/trunk projectname/trunk --force

 

개발서버 svn 이전 완료

 

8. 테스트 서버 저장소 이전

2, 6과 동일

 

테스트서버 svn 이전 완료

 

9. 실서버 새 SVN 저장소 checkout

2와 동일

 

10. 실서버 기존 저장소 디렉토리의 working copy를 새 저장소 디렉토리에 merge

7과 동일

추가된 파일은 복사되지 않았다. tar로 묶어서 가져가기로 함

 

11. 실서버 새 저장소와 기존 저장소가 일치하는지 확인

diff -qr --exclude=".svn" repository/trunk projectname/trunk

 

12. 실서버 기존 저장소 디렉토리(repository)에서 새 저장소 디렉토리(projectname)로 symlink 변경

6과 동일

 

실서버 svn 이전 완료

'Machine' 카테고리의 다른 글

django2 + centos6 + virtualbox  (0) 2018.03.28
Setup firewalld for PHP server on CentOS 7 minimal  (0) 2016.07.25
/usr/bin vs /usr/local/bin on Linux  (0) 2016.05.31
Synerge 1.3.1  (0) 2015.06.08
VMWare Player + CentOS 7 APM 설정  (0) 2015.04.05