I describe this task using the example of a transferred WordPress site to another folder of another domain.
To implement it, you need to search the database by domain name, you will see in which tables there are records with this domain. Then make a SQL query in the format:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'olddomainname.com', 'newdomainname.com/folder');wp_posts – table name
post_content – field in this table
olddomainname.com – old value to replace
newdomainname.com/folder – new value