Answer the question
In order to leave comments, you need to log in
How to copy the database correctly?
tell me how to correctly copy the database from the main domain to the domain for dev
, that is, the main site is located on www.domen.com and the version for dev will be www.dev.domen.com
So that all links in the database are replaced.
Answer the question
In order to leave comments, you need to log in
Export DB1 domen.com > Import DB1 domen.com into DB2 for dev.domen.com
Next, go to DB2 item SQL and paste this code:
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://domen.com', 'http://dev.domen.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE(guid, 'http://domen.com', 'http://dev.domen.com');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://domen.com', 'http://dev.domen.com');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question