The "copying filesystem content, database content" part of that is perfectly sane. I should have phrased that better.
The insane part is the search-and-replace on the database backup to find hard-coded URLs referencing the environment's hostname. That's ridiculous. It speaks to the lack of serious operational experience that went into building the software.
Ah. That’s like a 15-line rite-of-passage plugin you write once and never have to worry about it again. Filter content going into the database and use relative uri for the same site. Configure everything else via environment variables.
I moved away from Wordpress altogether earlier this year because I got tired of babysitting MySQL.