I wrote some docs on how to create a new replica host from scratch in https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Toolsdb#Creating_a_new_replica_host
I based it on the info in T329521, but some details are missing and we should really test it by creating a new replica and replacing the current one.