Compare commits
3 commits
4a74a1bec0
...
5d2a65079e
Author | SHA1 | Date | |
---|---|---|---|
5d2a65079e | |||
b36808de7c | |||
3e588c082c |
3 changed files with 43 additions and 1 deletions
41
doc/RenameDatabase.md
Normal file
41
doc/RenameDatabase.md
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# Rename Database
|
||||||
|
|
||||||
|
## Start
|
||||||
|
|
||||||
|
1. Scale down cloud deployment
|
||||||
|
`k -n nextcloud scale deployment cloud-deployment --replicas 0`
|
||||||
|
|
||||||
|
## Change db-name in postgres
|
||||||
|
|
||||||
|
1. Connect to postgres-pod
|
||||||
|
`k -n nextcloud exec -it postgresql-... -- bash`
|
||||||
|
2. Connect to a database
|
||||||
|
`PGPASSWORD=$POSTGRES_PASSWORD psql -h postgresql-service -U $POSTGRES_USER postgres`
|
||||||
|
3. List available databases
|
||||||
|
`\l`
|
||||||
|
4. Rename database
|
||||||
|
`ALTER DATABASE cloud RENAME TO nextcloud;`
|
||||||
|
5. Verify
|
||||||
|
`\l`
|
||||||
|
6. Quit
|
||||||
|
`\q`
|
||||||
|
|
||||||
|
## Update postgres-config
|
||||||
|
|
||||||
|
1. Edit configmap
|
||||||
|
`k -n nextcloud edit configmap postgres-config`
|
||||||
|
2. Update postgres-db value
|
||||||
|
3. Save
|
||||||
|
|
||||||
|
## Update nextcloud db-name
|
||||||
|
|
||||||
|
1. Scale up nextcloud
|
||||||
|
`k -n nextcloud scale deployment cloud-deployment --replicas 1`
|
||||||
|
2. Connect
|
||||||
|
`k -n nextcloud exec -it cloud-deployment-... -- bash`
|
||||||
|
3. Update db value in config.php
|
||||||
|
`apt update`
|
||||||
|
`apt install vim`
|
||||||
|
`vim config/config.php`
|
||||||
|
4. Update dbname field
|
||||||
|
5. Verify server+website is working
|
|
@ -26,7 +26,7 @@
|
||||||
(cm/concat-vec
|
(cm/concat-vec
|
||||||
(ns/generate (merge {:namespace "nextcloud"} config))
|
(ns/generate (merge {:namespace "nextcloud"} config))
|
||||||
(postgres/generate {:postgres-size :8gb
|
(postgres/generate {:postgres-size :8gb
|
||||||
:db-name "nextcloud"
|
:db-name "cloud"
|
||||||
:pv-storage-size-gb 50
|
:pv-storage-size-gb 50
|
||||||
:pvc-storage-class-name default-storage-class
|
:pvc-storage-class-name default-storage-class
|
||||||
:namespace "nextcloud"}
|
:namespace "nextcloud"}
|
||||||
|
|
|
@ -84,3 +84,4 @@ spec:
|
||||||
- name: rotation-credential-secret-volume
|
- name: rotation-credential-secret-volume
|
||||||
secret:
|
secret:
|
||||||
secretName: rotation-credential-secret
|
secretName: rotation-credential-secret
|
||||||
|
optional: true
|
||||||
|
|
Loading…
Reference in a new issue