Programming » Wordpress

Rename The Server

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:

  • Command Line

    Rename site CMD

  • PHPMyAdmin

    Rename site PHPMyAdmin [sm]

  • HeidiSQL

    Rename site Heidi SQL [sm]

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]%';


[old] - old server root name
[new] - new server root name

6. Load the site.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>