How do I reset a self-hosted WordPress URL?

i was using a wordpress install on an ubuntu server virtual machine. At first the adapter was host-only at an address of 192.168.55.55. The host had this on a vboxnet0 subnet.
i changed to bridged adapter to try port forwarding from the router, and now i cant access the page with the new address.
the new address is 192.168.1.5 and everything appears fine on routing tables of host.
i also cleared the dnsCache on the host.
but when i type in:
192.168.1.5/wordpress
in the browser, the activity bar shows it is trying to contact the old ip of 192.168.55.55, which was the vboxnet0 host-only adapter.

2 Answers
2

The easiest way to do this is by using copy&replace in the SQL file. Export the database. Use your favorite text editor and do a copy&replace and import it into a new database.

Then you go to wp-config.php and you change the WP_HOME and WP_SITEURL to the new host. Then you change the databasename. You also need to ensure that the same db user has access to the database.

Btw: There is a separate stackexchange for wordpress. Check out How do I move a WordPress site to another server?

Leave a Comment