1

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

5

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?

1

You can use this script to do the database find and replace without needing to do the SQL dump. Usual caveats apply - take a backup and delete the script after use. It's actually a better option that the text editor find & replace as it accounts for serialized arrays, which a text editor find & replace doesn't.

Wordpress (and others) search and replace tool

You'll still need to make the wpconfig.php edits manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.