If you have already designed a site with wordpress running in another server (ip only) and want to do a server migration to a live site, chances are the links to images or url appear as

http://1.2.3.4/wp-content/2018/0/image.jpg
http://1.1.1.1/this-is-a-blog-post

There could be thousands of links and images you might want to auto replace to the original domain name.

First login to mariadb in lightsail running in bitnami. Just run the following mariadb commands in your lightsail to replace ip address. Remember careful to use http or https

UPDATE wp_posts SET post_content = REPLACE(post_content,"http://34.x.x.120","https://example.com")
UPDATE wp_options SET option_value = replace(option_value, 'http://34.254.x.120', 'https://example.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://34.254.x.120','https://example.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://34.254.x.120', 'https://example.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://34.x.x.120','https://example.com');