Initial try for database export function, not working yet