mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-30 19:52:20 +01:00
Documentation about dumping the database
This commit is contained in:
parent
e9f91a36e9
commit
39fad9d0b0
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- Fix a bug: cookie consent modal is not shown
|
- Fix a bug: cookie consent modal is not shown
|
||||||
- Fix a bug: prevent task migrate_pdf_invoices_folders from raising an error when run with no invoices
|
- Fix a bug: prevent task migrate_pdf_invoices_folders from raising an error when run with no invoices
|
||||||
|
- Documentation about dumping the database
|
||||||
|
|
||||||
## v4.0.0 2019 June 17
|
## v4.0.0 2019 June 17
|
||||||
|
|
||||||
|
@ -18,6 +18,33 @@ This can be achieved doing the following:
|
|||||||
psql
|
psql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Dumping the database
|
||||||
|
|
||||||
|
Use the following commands to dump the PostgreSQL database to an archive file
|
||||||
|
```bash
|
||||||
|
cd /apps/fabmanager/
|
||||||
|
docker-compose exec postgres bash
|
||||||
|
cd /var/lib/postgresql/data/
|
||||||
|
pg_dump -U postgres fabmanager_production > fabmanager_production_$(date -I).sql
|
||||||
|
tar cvzf fabmanager_production_$(date -I).tar.gz fabmanager_production_$(date -I).sql
|
||||||
|
```
|
||||||
|
|
||||||
|
If you're connected to your server thought SSH, you can download the resulting dump file using the following:
|
||||||
|
```bash
|
||||||
|
scp root@remote.server.fab:/apps/fabmanager/postgresql/dump/fabmanager_production_$(date -I).tar.gz .
|
||||||
|
```
|
||||||
|
|
||||||
|
Restore the dump with the following:
|
||||||
|
```bash
|
||||||
|
tar xvf fabmanager_production_$(date -I).tar.gz
|
||||||
|
sudo cp fabmanager_production_$(date -I).sql .docker/postgresql/
|
||||||
|
rake db:drop
|
||||||
|
rake db:create
|
||||||
|
docker exec -it fabmanager-postgres bash
|
||||||
|
cd /var/lib/postgresql/data/
|
||||||
|
psql -U postgres -d fabmanager_production -f fabmanager_production_$(date -I).sql
|
||||||
|
```
|
||||||
|
|
||||||
<a name="postgresql-limitations"></a>
|
<a name="postgresql-limitations"></a>
|
||||||
## PostgreSQL Limitations
|
## PostgreSQL Limitations
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user