During the operation of main pipelines, many defects occur in the body of the pipe and on its surface. The main method for eliminating such defects is cutting out the defective section and welding a new one in its place. The cutting process is complicated by the possible sharp displacement of the ends of the pipeline located on both sides of the cutting site, which is dangerous for the lives of workers and can lead to breakage of the cutting equipment. In addition, to weld a new section, it is necessary to center the ends of the pipeline until they reach the alignment position, for which heavy, difficult-to-transport pipelayers are used, which allow centering the ends of the pipeline only by lifting them. Ensuring the possibility of such centering often requires additional digging of the repaired pipeline. Moreover, due to the large dimensions of pipelayers, payment of permits for their transportation is required. In addition, before transportation, pipelayers require their disassembly and assembly before carrying out repair work, which entails additional time and labor costs. To solve the problems described in this article, a developed design of devices for fixing and centering the ends of the pipeline is proposed, which makes it possible to fix the ends of the pipeline from their sharp displacement, and also to center them before welding a new section. A mathematical model was developed to assess the centering forces, the resulting stresses in the pipeline wall and the reaction forces that arise in the hydraulic cylinders of devices when leaving the ends of the pipeline in their sharp displacement. The initial data for the developed model are the coefficients of the polynomial describing the position of the pipeline in the repair trench. To accurately assess the position of the pipeline, a method of its laser scanning is proposed, the result of which is a point cloud of the pipeline. As part of the study, a method was also developed for the obtaining of a polynomial equation describing the bending of its central axis from a pipeline point cloud. As a result of experimental studies, this method has demonstrated sufficient accuracy in determining the position of the pipeline in the repair trench. Thus, the developed repair method makes it possible to increase both the safety of the repair and the technological and economic efficiency of the process of replacing a defective section.