0
votes

Have successfully moved my WordPress website from my localhost to a live server but the images are not showing and some pages as well. Some pages are still showing the localhost URL while another error message am getting is "That page can't be found".

I already changed my siteurl and Home column in my database table (wp_option) to the live server, but still the images are not showing yet. What should I do?

3
You need to export your database to .sql and then search & replace ALL occurences of http://localhost/ and replace it with your domain.xphan
Install wp-cli and use to search replace links like wp search replace mylocaldomain.com livedomain.com it will replace all columns in DB. Also, Make sure you have copied wp-content folder as it is as it contains all upload files and plugins.Spock

3 Answers

2
votes

You have to replace all localhost url in your database.

You should follow the steps below to move your database from local to live server:

  • Export your database to sql file

  • Use notepad++ open that sql file

  • Replace all localhost url to your live domain and save the file

  • Import the saved file to the live database

Note: make sure that you uploaded all the images to the live server

0
votes

I finally discovered a wonderful plugin that did it all. The plugin is called Velvet Blues Update URLs . Just Download the package. Extract it to the "plugins" folder of your WordPress directory. In the Admin Panel, go to "Plugins" and activate it. Go to Tools -> Update URLs to use it and then tick all the boxes to replace the old URLs with the new URLs.

0
votes

I would definitely recommend to use an automated plugin for the task. The one I use is Duplicator, by LifeInTheGrid. It is free and works perfectly to move a site from development to production and viceversa. Here is the link to it:

https://wordpress.org/plugins/duplicator/

I use it with all my sites and so far it has worked flawlessly.