926 B
926 B
Rename Database
Start
- Scale down cloud deployment
k -n nextcloud scale deployment cloud-deployment --replicas 0
Change db-name in postgres
- Connect to postgres-pod
k -n nextcloud exec -it postgresql-... -- bash
- Connect to a database
PGPASSWORD=$POSTGRES_PASSWORD psql -h postgresql-service -U $POSTGRES_USER postgres
- List available databases
\l
- Rename database
ALTER DATABASE cloud RENAME TO nextcloud;
- Verify
\l
- Quit
\q
Update postgres-config
- Edit configmap
k -n nextcloud edit configmap postgres-config
- Update postgres-db value
- Save
Update nextcloud db-name
- Scale up nextcloud
k -n nextcloud scale deployment cloud-deployment --replicas 1
- Connect
k -n nextcloud exec -it cloud-deployment-... -- bash
- Update db value in config.php
apt update
apt install vim
vim config/config.php
- Update dbname field
- Verify server+website is working