일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- SwiftUI
- Xcode
- SSL
- openssl
- MFA
- git
- FIDO2
- 2FA
- MYSQL
- albumbook
- 애플
- apple
- 앨범북
- 안드로이드
- OTP
- OSX
- Android
- WebAuthn
- kmip
- css
- 인증
- MSYS2
- 앱리소스
- appres
- SWIFT
- otpkey
- fido
- 앱스토어
- Nodejs
- SSH
- Today
- Total
인디노트
How to upgrade PostgreSQL from version 9.6 to version 10.1 without losing data? 본문
How to upgrade PostgreSQL from version 9.6 to version 10.1 without losing data?
인디개발자 2019. 1. 10. 21:49Assuming you've used home-brew to install and upgrade Postgres, you can perform the following steps.
Stop current Postgres server:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Initialize a new 10.1 database:
initdb /usr/local/var/postgres10.1 -E utf8
run
pg_upgrade
(note: change bin version if you're upgrading from something other than below):pg_upgrade -v \ -d /usr/local/var/postgres \ -D /usr/local/var/postgres10.1 \ -b /usr/local/Cellar/postgresql/9.6.5/bin/ \ -B /usr/local/Cellar/postgresql/10.1/bin/
Move new data into place:
cd /usr/local/var mv postgres postgres9.6 mv postgres10.1 postgres
Restart Postgres:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Check
/usr/local/var/postgres/server.log
for details and to make sure the new server started properly.Finally, re-install the rails
pg
gemgem uninstall pg gem install pg
I suggest you take some time to read the PostgreSQL documentation to understand exactly what you're doing in the above steps to minimize frustrations.
'개발 플랫폼 및 언어 > DB 기술' 카테고리의 다른 글
MYSQL root password change from 8.x (0) | 2020.08.24 |
---|---|
PostgreSQL Introducing Multi-Master (0) | 2019.01.11 |
Postgres-BDR (0) | 2019.01.10 |
Dynamic SQL-level configuration for BDR 0.9.0 (0) | 2019.01.10 |
Postgresql 10 Logical replication, Pgpool-II (1) | 2019.01.10 |