How do I move Wordpress to a new domain name?

Procédure

Why change the domain name of your Wordpress blog?

In some cases, it may be necessary to change the domain name of your Wordpress blog to better reflect the nature of your blog.

If you want tochange the location of your blog and its domain name, there are a few important steps to take into consideration so as not to break certain links and end up with 404 errors on your pages and the links you have inserted in your articles.

What should I do before migrating my Wordpress site?

Before you start migrating your website to Wordpress, make sure you have a backup of your website. If you don't have a backup, you need to make one before starting the migration. The backup is done in two stages:

Order your web space with your domain name

1. Choose the Wordpress package best suited to your needs and click on the"Order" button below the package in question.

How do I move Wordpress to a new domain name?


2. Choose your domain name and click on the"Continue with my order" button.

How do I move Wordpress to a new domain name?


3. Tick the box behind the extension you want for your domain name and click on the"Order" button.

How do I move Wordpress to a new domain name?


4. Choose the"Basic Domain" or"Business Domain" option according to your needs. Click on"Continue my order" as soon as you have chosen the option.

How do I move Wordpress to a new domain name?


5. Click on the"Confirm my order" button to continue the process.

How do I move Wordpress to a new domain name?


6. Answer the question asking if you are already a customer.

How do I move Wordpress to a new domain name?


7. Enter the owner's contact details and the billing details if they are different.

How do I move Wordpress to a new domain name?


8. Choose the payment method for your Web hosting package

How do I move Wordpress to a new domain name?


The service is set up within one hour of your order.

Publish your website using an FTP client.

As soon as your service is active on your customer account, you will receive an email with all the information you need to connect via FTP to your web space. You will need to publish via FTP all the directories and files that you have previously saved on your computer. You can use the"Publish a site via FTP" help file.

Importing your Wordpress database.

The steps for importing the database are as follows:

Modifying your MySQL database

The last step is to update the information in your database about the location of your new Wordpress blog. To do this, connect to your MySQL database using PhpMyAdmin.


1. Click on the"SQL" button

How do I move Wordpress to a new domain name?


2. Type the following command, remembering to change the value"old-domain.com" to your old domain name and"new-domain.com" to your new domain name. Then click on the"Execute" button. This request will change your old domain name to the new one in the"wp-options" database of your Wordpress blog.

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

How do I move Wordpress to a new domain name?


3. The second step is to repair the URLs of all your articles and web pages. Click on the"Execute" button to modify your database. The purpose of this request is to modify the links in the"wp_posts" database.

UPDATE wp_posts SET guid = replace(guid, 'http://www.ancien-domaine.com','http://www.nouveau-domaine.com');

How do I move Wordpress to a new domain name?


4. You may have set up internal links on your articles. These links now point to URLs that no longer exist. This can cause 404 errors. To modify these links in the"wp_posts" database, you need to use the command below. Don't forget to click on the "Execute" button so that your request is taken into account.

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.ancien-domaine.com', 'http://www.nouveau-domaine.com');

How do I move Wordpress to a new domain name?

Conclusion

You can now move Wordpress to a new domain name without losing any data with LWS. Before you start migrating your Wordpress site, it's essential to make a backup.

Don't hesitate to share your comments and questions!

Rate this article :

5/5 | 1 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

2mn reading

How do I create a Wordpress website?

2mn reading

How do I reset my Wordpress password?

0mn reading

Error connecting to the database on Wordpress

2mn reading

Our Wordpress packages


Ask the LWS team and its community a question