This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration PostgreSQL
ZeroC0D3 Team edited this page Jan 26, 2018
·
2 revisions
Customize data directory PostgreSQL for Ubuntu 16.04
- Check
data_directory
position
sudo -i -u postgres
psql
-------
postgres=# SHOW data_directory;
data_directory
-------------------------------------------
/var/lib/postgresql/9.6/main
(1 row)
- Restart service PostgreSQL
sudo service postgresql stop
### OR ###
## /etc/init.d/postgresql stop
- Rsync to new
data_directory
sudo rsync -av /var/lib/postgresql /home/deploy/database
- Backup old configuration PostgreSQL
sudo mv /var/lib/postgresql/9.6/main /var/lib/postgresql/9.6/main.bak
- Edit configuration PostgreSQL for new location
sudo nano /etc/postgresql/9.6/main/postgresql.conf
------
. . .
data_directory = '/home/deploy/database/postgresql/9.6/main'
. . .
- Restart PostgreSQL Services
sudo service postgresql start
### OR ###
## /etc/init.d/postgresql start
- Validate new
data_directory
position
sudo -i -u postgres
psql
-------
postgres=# SHOW data_directory;
data_directory
-------------------------------------------
/home/deploy/database/postgresql/9.6/main
(1 row)
- References: Digital Ocean - PostgreSQL
Research & Development (RnD) - ZeroC0D3 Team
- Email: zeroc0d3.team@gmail.com
- Repository: https://github.com/zeroc0d3lab
- Install-Packages
- Setup-Server
- Setup-Account
- Configuration-Bash
- Configuration-Zsh
- Install-Bash-Theme
- Install-Zsh-Theme
- Install-Docker
- Install-Memcached
- Install-MongoDB
- Install-MySQL
- Install-NodeJS
- Install-PostgreSQL
- Install-Redis
- Install-Ruby
- Install-SQLite3
- Configuration-App
- Configuration-GCM
- Configuration-Hosts
- Configuration-Fstab
- Configuration-Memcached
- Configuration-MongoDB
- Configuration-PostgreSQL
- Configuration-Puma
- Configuration-Swap
- Configuration-Unicorn
- Nginx-Puma
- Nginx-Unicorn
- Logrotate
- Deployment-Dashboard
- Deployment-Configuration
- Deployment-Process
- Deployment-Folder-Structure
- Deploy-Preinstall