Aiming at the problem that the transfer accuracy of profile inversion model in different pipeline fields is not high enough in magnetic flux leakage (MFL) inspection, this paper presents a general inversion method. Firstly, the defect features of different pipelines are transferred by transfer component analysis (TCA), to reduce the difference of data probability distribution between them. Then, the post-transfer defect features are used to perform defect inversion with random forest (RF) algorithm. The real data are required from the domestic in-service oil pipelines in experiments. The experimental results show that the proposed method can effectively develop inversion accuracy by applying the inversion model into other pipeline fields.