Moving your WordPress site is certainly not something that you are do it everyday, but it is better to know how this is done.
Save your data
If you really care about your WordPress site, I hope that this step will not be necessary for you, because of course, you save it regularly.
If you do not frequently back up your WordPress website, remember that you must also back up your files, as well as data stored in your database.
Recovering the WordPress files
Nothing complicated. Use your favorite FTP client, FileZilla for ex. Log in, download all the directories needed for the proper functioning of your site. Watch in CGI BIN directory.
Collect WordPress data
Again, nothing too serious. Connect to the phpMyAdmin interface of your site. Go to Export tab of the database. As a precaution, always make two backups, one with Quick – display only the minimal options and a custom one, I usually use gzip archive for it.. One is never too careful.
Now that you have all your data on your computer, you must do the reverse process; send the data to your new server.
This time, you send your data to the FTP server, and you select the Import tab in the new phpMyAdmin.
The longest stage being here, often wait for the FTP transfer to terminate.
Once your data transferred to the new server successfully, it could be that you are confronted with the obligation to make some small adjustments. It depends on the case.
Of course, if you change the server, there is a very high probability that the connection to MySQL password is no longer good, see also that the user has changed, and the name of the table.
One of the steps needed to be functional if the site is migrated is to edit the wp-config.php file.
Replace the old data with those that are now good.
Domain not changed
In that case … your migration is complete. It is possible to sign on this website as you did on the previous one.
Easy, isn‘t it?
If your moving also involves a change of domain name, then you will have to tell WordPress. And to tell him, no secret, you will have to go through the database tables. Why? Because WordPress stock the domain name as a variable in the database. Otherwise, when you change the domain name, your old installation will not be directly accessible after copying the data.
If your site has a certain size, you can quickly imagine that editing the base through phpMyAdmin is an art. But you can change it in two different way:
open the database .sql file in a text editor, search for domain name in the wp_options table and replace it, than upload the changed database file through phpMyAdmin, or
go directly to phpMyAdmin clic the wp_options table, search in it for the domain name anmd replace it with the new domain name.
Usually, there are two places where you have to replace the domain name.
Test your WordPress website and, Oh, magic, your moving is perfectly functional.
But one small detail until you have completely finished with your moving of the WordPress website, remember to remove the script from your web server. To avoid possible exploits.