Writing previous version to data directory (and create datadir if non existing