add dumping / backup restoring / setup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MVHub |
Confirmed
|
Low
|
Unassigned |
Bug Description
##############
version #1 notes
##############
There is a backup procedure for databases running on csl-db-02
However, it is a bit of a kludge, works only for CSL hosted sites, is insufficiently documented and is not stored in version control.
The existing bash script is pasted at bottom of this bug report.
We are done when:
invoking:
app-
puts a database dump based on existing bash script in:
mv_backup should use
MVHub:
to get:
the database password / host / user and $backup_dir
and should use system() call to pg_dump
files to modify:
# to create /var/www/
app-
# RELATIVE_
app-mvhub/
/var/www/
/var/www/
# add a cron entry
./app-mvhub/
# update to run backup daily for each site
/app-mvhub/
##############
version #1a notes
##############
Also include images and .css files in the backup
##############
version #2 notes
##############
See also:
538143 export to our data CSV
397162 [f] schema and meta data loader / updater & separate data from
schema creation
538763 IRS / NTEE codes / categories for data sharing
...these are overlapping but different
Dump user created data and meta data as csv, so instead of a raw database dump, just the relivant tables.
It should be possible to restore the database from the backup and the
schema setup.
##############
#!/bin/bash
export PGPASSWORD=
export NOW=` date +%Y-%m-%d-%H_%M-%a`
export MVH_DUMP_
export NSP_DUMP_
pg_dump \
--format=c \
--file $MVH_DUMP_FILE.dump \
-h localhost \
-d production.mvh \
-U production
pg_dump \
--format=p \
--file $MVH_DUMP_FILE.sql \
--no-owner \
--clean \
--no-acl \
-h localhost \
-d production.mvh \
-U production
pg_dump \
--format=c \
--file $NSP_DUMP_FILE.dump \
-h localhost \
-d production.nsp \
-U production
pg_dump \
--format=p \
--file $NSP_DUMP_FILE.sql \
--no-owner \
--clean \
--no-acl \
-h localhost \
-d production.nsp \
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: |
added: time-40+hrs removed: 40-plus-hours |
description: | updated |