-4

I made a new website for one client, he had his purchased domain on go daddy, I transferred his domain to Hostgator and for trial, I designed the new Web on a subdomain, via WordPress, now after all things, I want to delete his old website and put this new one on his domain, and his old website is not created on WordPress so I don't have any files of that Web.

  • This is not a question and is too open-ended for Stack Overflow. Please keep questions specific. – ryanttb Sep 11 '21 at 20:57
  • Welcome to Stackoverflow!, Unfortunately, This question is a little bit too vague, it asks very generally for what would constitute a tutorial instead of asking a specific question. Therefore it is not suitable for stackoverflow as Stackoverflow is not a tutorial provider or a free code writing service, I recommend new users to review the [How to ask](https://stackoverflow.com/help/how-to-ask) section of stackoverflow for tips on asking questions that are well-suited for the site and best enable the community to provide helpful feedback. Goodluck :) – I_love_vegetables Sep 12 '21 at 05:42
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Sep 14 '21 at 06:03

1 Answers1

1

There is tons of tutorials on internet...

You just have to migrate files from your subdomain folder to your main folder (or change the folder where your main domain is pointing) and change the wordpress url on your DB with a SQL command like that :

UPDATE wp_options
SET option_value = replace(option_value, 'http://www.ancien-site.com', 'http://www.nouveau-site.com')
WHERE option_name = 'home'
OR option_name = 'siteurl';

UPDATE wp_posts
SET guid = REPLACE (guid, 'http://www.ancien-site.fr', 'http://www.nouveau-site.fr');

UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://www.ancien-site.fr', 'http://www.nouveau-site.fr');

UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, 'http://www.ancien-site.com','http://www.nouveau-site.com');

then rebuild permalinks, and check if everything is ok.

Pof
  • 829
  • 5
  • 20