Implement database backup

Work in progress