Moving your WordPress site to a new server can be accomplished in a number of ways. You should only use this method if you wish to change the domain name that your WordPress site is hosted on while you are moving the site to a new server or host. In other words, you should only use this method if you are moving the site from one server or host to another.
Note: If you merely want to modify the domain name associated with your WordPress site, see Changing Your WordPress Domain Name.
Installing WordPress on your hosting account is the first step in getting started with it. After you have installed WordPress, you will need to first export your current website together with its database, and then on the new server, you will need to import both the website and the database. In order to finish the procedure, you need to make sure that your wp-config.php file is up to date and fix any broken links that may exist on your website.
You should export and download your website off of the server.
To be able to export and download your WordPress site from its current host, you will first need to create a backup of its existing database and then gain access to the WordPress files that are stored on that host’s server.
- Locate the database that is being used by your WordPress website, and after that, produce a backup of your database in the form of a SQL file.For more information, see the official WordPress documentation.
- Through the use of the File Transfer Protocol, connect to your existing hosting account (FTP).For more information see What is File Transfer Protocol (FTP)?
- Get the whole WordPress folder saved to your PC by doing a download of it all.
Transfer and set up a WordPress website in a new location.
You will need access to both the new hosting server as well as the database in order to import and upload your WordPress site to our servers.
- Use FTP to establish a connection to your brand-new hosting account.
- The contents of the WordPress folder that you saved should be uploaded and replaced.
- Make a fresh database using MySQL.(cPanel / Plesk).
- Take note of the Database Name, the Host Name, and the password that you used to access the database.
- Copy the SQL file that you saved into the new database that you created. For more information, see Import SQL files into a MySQL database.
Ensure that your wp-config.php file is up to date.
You will need to edit the wp-config.php file with your new domain name in order to get your website up and running again.
- Launch the File Transfer Protocol (FTP) software and access the wp-config.php file.
- Insert the following two lines into the file, being sure to replace example.com with the address of your actual website.
- define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’);
- Locate the section that looks like this example:
/** The name of the database for WordPress */ define(‘DB_NAME’, ‘putyourdbnamehere’); /** MySQL database username */ define(‘DB_USER’, ‘usernamehere’); /** MySQL database password */ define(‘DB_PASSWORD’, ‘yourpasswordhere’); /** MySQL hostname */ define(‘DB_HOST’, ‘localhost’);
- Enter the database information from your database as follows:
- putyourdbnamehere: Replace this with your MySQL Database Name.
- usernamehere: Replace this with your MySQL Database Username.
- yourpasswordhere: Replace this with your MySQL Password.
- localhost: Replace this with your MySQL Host Name.
- Save your modifications.
Fix broken links after moving your WordPress site
- Finally, you need to clean your site of outdated link paths.
- Log in to your WordPress account.
- Choose Add New from the Plugins menu to install a new plugin.
- Better Search Replace is what you should type.
- Locate the Better Search Replace plugin, then select Install Now from the menu.
- Select the Activate option once the plugin has been successfully installed.
- Choose “Better Search Replace” from the section labeled “Tools.”
- In the section labeled “Search for,” type the URL of your previous website. Take, for instance, http://olddomainexample.com as an example (no trailing slash).
- In the section labeled Replace with, enter the URL of your new website. Take, for instance, http://newdomainexample.com as an example (no trailing slash).
- Choose each table in the database from the drop-down menu in the Select tables area.
- Remove the checkmark from the box labeled Run as dry run.
- To modify the URLs stored in the database, use the Run Search/Replace option.
- Open up your WordPress configuration file (wp-config.php) in the File Transfer Protocol (FTP) client and delete the lines that are listed below:
define(‘WP HOME’,’http://example.com’); define(‘WP SITEURL’,’http://example.com’);
You have been successful in changing the name of your domain and transferring your website to a different server or host.
Welcome to the world of DomainRooster, where roosters (and hens) rule the roost! We're a one-stop shop for all your entrepreneurial needs, bringing together domain names and website hosting, and all the tools you need to bring your ideas to life. With our help, you'll soar to new heights and hatch great success. Think of us as your trusty sidekick, always there to lend a wing and help you navigate the sometimes-complex world of domain names and web hosting. Our team of roosters are experts in their fields and are always on hand to answer any questions and provide guidance. So why wait? Sign up today and join the ranks of the world's greatest entrepreneurs. With DomainRooster, the sky's the limit! And remember, as the saying goes, "Successful people do what unsuccessful people are not willing to do." So don't be afraid to take that leap of faith - DomainRooster is here to help you reach for the stars. Caw on!