David
asked on
wordpress - mysql - update path in all posts
Hi,
We have moved a wordpress site from a temporary server to the new server.
The mysql database is littered with the path details for anything from images to posts with the following in long lines in the database
http://185.123.97.162/~username/mydomain.com/etc etc etc
Is there a command i can use to search for any reference for the above to change it to
http://mydomain.com/etc etc etc
Or is there another way to do this?
I have tried changing the permalink to default the back again but no joy there
Thanks
We have moved a wordpress site from a temporary server to the new server.
The mysql database is littered with the path details for anything from images to posts with the following in long lines in the database
http://185.123.97.162/~username/mydomain.com/etc etc etc
Is there a command i can use to search for any reference for the above to change it to
http://mydomain.com/etc etc etc
Or is there another way to do this?
I have tried changing the permalink to default the back again but no joy there
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
for example one post in the MySQL is
css=".vc_custom_1470043286 616{paddin g-bottom: 40px !important;background: #e7ebf0 url(http://185.123.97.162/~user name/mydom ain.com/ wp-content/uploads/2016/05 /rion-Key- Drivers.jp g?id=970) !important;background-posi tion: center !important;background-repe at: no-repeat !important;background-size : cover !important;}" el_class="related"][vc_col umn][vc_co lumn_text disable_pattern="false" align="center"]
css=".vc_custom_1470043286
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
unfortunately the plugin copied over the path
I think we can do this by some kind of query on each table but advice on this would be appreciated
I think we can do this by some kind of query on each table but advice on this would be appreciated
ASKER
for example in the wp0m_posts table there are 2368 items int eh post_content" that need to be found and replaced
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
addendum - the advantage of the above method is you don't need to know the structure / use of the tables. This reduces to a search and replace operation. Once the DB is restored paths throughout the DB should be changed.
ASKER
That was a great tip and updated all the links!!
The problem i have now is the site has a few issues now with image sizes and the logo has reverted back to the template default. Do you know why this migth be?
The problem i have now is the site has a few issues now with image sizes and the logo has reverted back to the template default. Do you know why this migth be?
If you search the old db for the logo image and then find the corresponding in the new - what is the difference?
If you just replaced the domain names and paths for the URL's it should not affect the image sizes.
If you just replaced the domain names and paths for the URL's it should not affect the image sizes.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So i want any reference to http://185.123.97.162/~username/mydomain.com/ to be changed to just http://mydomain.com