Prepare for storage the metadata in the database