Populates correctly the db with all metainfo from header (could benefit from a function to make code more compact)