start of writing restore data to local db 4