최근에 sqlite로 데이터를 수집했는데 양이 너무 많아서 반으로 쪼개기도 하고 postgres로 옮겨두고 사용하려 한다.
파일 디비다 보니 다루기가 쉽지 않고 불편한게 많기도 하다.
찾아보니 뭐 쓸만한건 잘 안보이고
www.fullconvert.com/howto/sqlite-to-postgres
Convert SQLite to PostgreSQL | Full Convert
Database migration tutorial - quickly copying tables, indexes, foreign keys and data. Convert SQLite to PostgreSQL.
www.fullconvert.com
이런게 있어서 한번 써봄
단점이 있다면 윈도우에서만 된다는 것과 public schema에만 들어간다는 것?
물론 테이블쪽 마이그레이션 옵션에 manual 모드가 있어서 타입이나 항목 명을 변경하는 것이 가능하다.
스키마와 테이블 이름도 변경은 되지만 몇백개 되는 테이블을 옮기려니 좀 어려울거 같아서
일단 옮기고 나중에 스키마를 옮기는 식으로 진행하려 한다.
그게 그거려나?
가격은 일회성 마이그레이션에 너무 큰돈이 들어가는 것 같아서 좀 그렇고 다른 걸 알아봐야 할 것 같다
그래서 이제 또 알아본게 pgloader, 오픈소스이고
pgloader
Continuous Migration to PostgreSQL
pgloader.io
dimitri/pgloader
Migrate to PostgreSQL in a single command! Contribute to dimitri/pgloader development by creating an account on GitHub.
github.com
양이 많아서 걱정이었는데 생각보다 잘들어간다
$ apt-get install pgloader
$ pgloader [source] [target]
이렇게만 하면 바로 끝난다 생각보다 쉬운편
postgresql://{id}@{url}:{port}/{schema}
참고로 postgres 경로는 이렇게 작성한다. 비밀번호는 따로 입력 안한거 같음
'dev > 삽질' 카테고리의 다른 글
grafana docker compose 과정에서 에러 발생 (0) | 2021.04.30 |
---|---|
wsl 도커 적용 관련 명령어 (0) | 2021.04.27 |
WriteFileHandle: Can’t open for write without O_TRUNC on existing file without –vfs-cache-mode >= writes (0) | 2021.04.22 |
Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed: cgofuse: cannot find winfsp (0) | 2021.04.22 |
windows10 wsl 비밀번호 까먹었을 때 (0) | 2021.04.22 |