Change site URL and WordPress URL in Localhost

后端 未结 7 1187
温柔的废话
温柔的废话 2020-12-05 06:02

I am work in Wordpress. And my system localhost url is http://localhost:8080/wordpress.
I want to shift our site another system.

My problem is that my another sy

7条回答
  •  遥遥无期
    2020-12-05 06:23

    You have to be very careful about the search and replace and ensure that any serialized data in any of your tables is properly unpacked, updated and re-packed.

    If your target site is usable you can use various things to update its data to use the new URL format.

    If you're comfortable with the command line you can use the WP-CLI with a command like:

    wp search-replace http://localhost:8080/wordpress http://localhost/wordpress
    

    For a WordPress Admin Dashboard tool I'd recommend the free Better Search Replace plugin.

    If the URL needs to be changed before loading the data into the new site's database, I'd recommend using the free WP Migrate DB plugin to export your database with a find/replace pair of "//localhost:8080/wordpress" and "//localhost/wordpress" (without quotes). You can then run the exported SQL file against your target site's database.

提交回复
热议问题