The structural system integrity in historical masonry buildings is studied by developing the concept of the Digital Twin. The objectives are to develop a procedure for creating an accurate digital model, which integrates the experimental physical reality and to use it to study the structural response of the system, its preventive maintenance and strengthening operations.The key elements examined are the building of an accurate three-dimensional geometric model, the choice of material properties and, the consideration of construction stages along the history. The relation to structural surveys, in situ observation and measurements is explored, with particular attention to reproducing the damage observed. Non-Linear Finite Element modelling is adopted. The structural system is generated in a semi-automatic way, reducing time-consuming modelling tasks and reaching a good approximation of real geometry as well as having an efficient discretization in a finite element model.This procedure can be used to assess with high precision the present structural conditions of the system, study its future evolution for preventive maintenance or practical interventions as well as to understand past documented failures of structural members of the building.An application considered in Milan Cathedral demonstrates the applicability and advantages of the proposed procedure in complex buildings.