본문 바로가기

앱태크

Firestore 프로젝트 생성시 정했던 region 변경

처음에 프로젝트 만들때 아무생각 없이 region 을 정했는데 , 나중에 변경하고 싶은 일이 꼭 온다. 

 

구글링 해보니 못바꾼다고 하여 포기 하였지만...

 

구글 가이드에 자세히 나와 있다니...앞으로는 가이드를 더 꼼꼼히 읽어 봐야겠다.

 

https://cloud.google.com/firestore/docs/manage-data/export-import

https://cloud.google.com/storage/docs/creating-buckets

https://cloud.google.com/storage/docs/moving-buckets

 

 

순서는 이렇다 .

 

*firestore billing을 blaze 로 선택해야 진행가능

*import,export 할때 storage 마다 permission 변경 필요 . 아이디를 넣어서 role 지정 (storage admin)

 

1. 원래 A 프로젝트안에 storage에서 A와 같은 region으로 버킷 생성( 버킷1)

2. firestore data를 버킷1에 export (구글 가이드 참조)

3. A 프로젝트 안에 변경하고 싶은 region 으로 버킷 생성(버킷2)

4. storage 안에 transfer사용해서 버킷1 -> 버킷2 로 이동

5. GCP 에서 새로운 프로젝트 생성(새로운 firebase 프로젝트)

6. GCP firestore로 들어가서 firestore or datastore 둘중에 firestore 설정 ( region 등등 )

7. 버킷2 데이타를 새로만든 GCP 프로젝트로 import

8. import 후 firebase에서 새로운 프로젝트 생성시 GCP에서 만든 프로젝트로 생성.

 

 

 

다음 도전은 json , csv 파일을 firestore 에 올리기 !