OpenRiskNet / home

OpenRiskNet wiki and core resources
14 stars 9 forks source link

Backup and restore for PostgreSQL #11

Closed tdudgeon closed 5 years ago

tdudgeon commented 6 years ago

We need to handle backups for the prostgres database in the openrisknet-infra project

alanbchristie commented 6 years ago

A Postgres Backup and Recovery recipe can now be found in the recipes directory.

https://github.com/OpenRiskNet/home/blob/master/openshift/recipes/postgres-backup-and-recovery/README.md

GrahamDumpleton commented 6 years ago

FWIW, in the jupyter-on-openshift/jupyterhub-quickstart repo, I have a script that can run as a managed service in JupyterHub container, that will periodically look for changes to user details and write out a snapshot to the file system, as well as optionally write it back to a config map.

In the jupyterhub_config.py file you would then have:

c.JupyterHub.services = [
    {
        'name': 'backup-users',
        'admin': True,
        'command': ['backup-user-details',
                '--backups=/opt/app-root/notebooks/backups',
                '--config-map=%s-cfg-backup' % jupyterhub_service_name]
    }
]

This provides a simple way of being able to save user details so that if the database is corrupted, you just need to start over with a empty database and then reload the users again.

Can be used as light weight alternative to having full PostgreSQL backups.

tdudgeon commented 5 years ago

Closing as this has been implemented.