Methods of rehabilitation of gravity pipelines and pipelines under pressure