I'm redesigning a site that originally didn't have a SSL. I copied the uploads directory, then did regular expressions on the wp db export
file from the original site.
In the Media Library, none of the thumbnails are showing up.
In the developer console it is showing a bunch of requests to the root of the domain, rather than having the image names.
If I go to the URL that shows up in the inspector and use the https
version, the image appears.
I've already tried wp media regenerate
, but they still are not showing up. Where do I need to go to change the protocol the media library is using?
I'm redesigning a site that originally didn't have a SSL. I copied the uploads directory, then did regular expressions on the wp db export
file from the original site.
In the Media Library, none of the thumbnails are showing up.
In the developer console it is showing a bunch of requests to the root of the domain, rather than having the image names.
If I go to the URL that shows up in the inspector and use the https
version, the image appears.
I've already tried wp media regenerate
, but they still are not showing up. Where do I need to go to change the protocol the media library is using?
Okay, the issue was my last regular expression that changed the http:
to https:
did not save. I reran the expression again and refreshed the page and it worked.
Here's the gist of how to do this (with wp cli) for anyone who comes across this.
In the original site directory:
wp db export
This should create a .sql
file with the original database name and a hash, like db_name-324ddsx9.sql
. FTP that file to your new server/install directory. Then edit it with vi and perform the search and replace. You want to replace all instances of the original domain with the new one.
sudo vi db_name-324ddsx9.sql
:%s/oldsite_name/newsite_name/g
:%s/http\:\/\/newsite/https\:\/\/newsite/g
:wq
If you haven't already, create the mysql database. Then from the command line - import the sql.
mysql -u root -p database_name < db_name-324ddsx9.sql
And that should have you set to go.