Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How can I replace old urls with the new one's from the database (phpMyAdmin)?

+2 votes
112 views
asked Nov 28 in Q2A Core by froyd
edited Nov 28 by froyd
I currently migrate the website to a new host with a new domain, how can I replace old urls inside the posts with the new one's from the database (phpMyAdmin)?

It was really very hard to edit each questions/answers post. Thank you in advance

1 Answer

+3 votes
answered Nov 29 by arjunsuresh
selected Nov 29 by froyd
 
Best answer
Ideally you should migrate your old domain to new name using 301 rewrite rules which will help you retain old search scores and also ensures all the old links work. Now, if by any chance old ones are dead you can do this query in MYSQL.

update qa_posts set content = REPLACE(content, 'http://example1.com', 'http://example2.com');

where example1.com is the old name and example2.com is the new one.
commented Nov 29 by froyd
edited Nov 29 by froyd
thank you so much for this, arjunsuresh. It helps me  alot. There is one bugging me, the layout of the theme cannot be edited. (the show logo/image, custom html at the sidebar, side pannel, at the head, custom content, meta cannot be edited when save). It only shows white screen with text.

403
Forbidden

Access to this resource on the server is denied!
commented Nov 29 by arjunsuresh
Which theme?
commented Nov 29 by froyd
The donut theme (the theme of my previous website which I migrated to a new host). I also tried the classic the snowflat but unfortunately I cannot possible edit the layout of the theme.
...