Answers for "wordpress manually migrate sql commands"

SQL
0

updated sql wordpress database migration script

-- Query 1: update the wp_options table
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://original.domain.com', 'https://new.domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

-- Query 2: update the wp_posts table
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://old.domain.com', 'https://new.domain.com');

-- Query 3: update the wp_posts table
UPDATE wp_posts SET post_excerpt = REPLACE (post_excerpt, 'http://old.domain.com', 'https://new.domain.com');

-- Query 4: update the wp_postmeta table
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://old.domain.com','https://new.domain.com');

-- Query 5: update the wp_comments table
UPDATE wp_comments SET comment_content = REPLACE (comment_content, 'http://old.domain.com', 'https://new.domain.com');

-- Query 6: update the wp_comments table
UPDATE wp_comments SET comment_author_url = REPLACE (comment_author_url, 'http://old.domain.com','https://new.domain.com');

-- Query 7: update the wp_comments table
UPDATE wp_posts SET guid = REPLACE (guid, 'http://old.domain.com', 'https://new.domain.com') WHERE post_type = 'attachment';

-- Alternative Query 7 for migrations from localhost enviroments
-- UPDATE wp_posts SET guid = REPLACE (guid, 'http://old.domain.com', 'https://new.domain.com');
Posted by: Guest on October-10-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language