To rename the server root and all relative paths for posts and images follow these steps:
1. Rename the server root itself or the site folder on localhost
2. Open a MySQL tool:
3. Select the database
4. Rename it if you need
5. Run these SQL commands:
update wp_options set option_value=replace(option_value,'[old]','[new]') where option_value like '%[old]%'; update wp_postmeta set meta_value=replace(meta_value,'[old]','[new]') where meta_value like '%[old]%'; update wp_posts set post_content=replace(post_content,'[old]','[new]') where post_content like '%[old]%'; update wp_posts set guid=replace(guid,'[old]','[new]') where guid like '%[old]%';
where
[old] - old server root name [new] - new server root name
6. Load the site.