How to change an wordpress installed using an IP to a domain name


#1

Hi, I have installed easyengine on an IP. I have done changes while running the wordpress on IP. Now i have assigned the IP to a domain name. Now how i will going to change this IP to domain. As my database will be holding that IP everywhere. How i going to replaceIP everywhere in database with the domain name i have assigned to that IP. I am using google compute engine. Before i was using bitnami wordpress for GCE. there was a command that do all this part . Cammand for bitnami is sudo /opt/bitnami/apps/wordpress/bnconfig --machine_hostname domain_name. Do you have a similar command or some other procedure to do this??


#2

I have the same issue. Can’t wait for experts help!


#3

Any luck till now?


#4
cd /var/www/domain.com/htdocs
wp search-replace http://1.2.3.4 http://domain.com --dry-run

The above command will expose which tables would be modified, how many records per table. If your fine with this summary repeat the last command without --dry-run and your entire database will be modified.

There are other threads about this exact same issue with far more information, you should take a look at the search.


#5

Does i have to make any other changes to run my wordpress install on domain name rather than IP. like change in server config?


#6

Please, search the forum.

This question has been answered with plenty of details.


#7

Hi porttofacial, I yesterday i have mapped my domain name with to my IP. after that i run this command ee site edit and replaced IP with my domain name here server_name ;

after that i run your mentioned command cd /var/www/domain.com/htdocs wp search-replace http://1.2.3.4 http://domain.com --dry-run and replaced IP with my domain name. Then i made changes to my wp-config.php file and replace IP with my domain name.

Now i am getting redirection loop.

But when i edit my server_name back to ip. There is no redirect loop then.

What is the issue. I am not able to figure it out.

Here is my site-enabled Nginx configs

server { # Uncomment the following line for domain mapping # listen 80 default_server; server_name my-domain.com .my-domain.com; return 301 $scheme://my-domain.com$request_uri; # Uncomment the following line for domain mapping #server_name_in_redirect off; access_log /var/log/nginx/104.154.95.37.access.log rt_cache_redis; error_log /var/log/nginx/104.154.95.37.error.log; root /var/www/104.154.95.37/htdocs; index index.php index.html index.htm; include common/redis.conf; include common/wpcommon.conf; include common/locations.conf; include /var/www/104.154.95.37/conf/nginx/.conf;


#8

You didn’t follow my directions.

The --dry-run parameter is useful for testing purposes. Once you are fine with the changes it will make, you should repeat the same command without the --dry-run part to actually perform the replacements.

I am sorry, perhaps my English is not clear enough.


#9