How to move a WordPress blog to another domain

The first step is to make a backup of your database and of your wp-config.php file.

In order to make a backup of the WordPress tables inside your database you have to access to PhpMyAdmin application and you must export your database’s tables to an “.sql” file.

Regarding the configuration file “wp-config.php” usually it’s situated in the main folder of your WordPress installation. It contains the informations regarding your database (URL, user, password, DB name, and WP tables prefix).

Export the database’s tables

Now you have to export the database’s tables to another file “.sql” which you’ll use for the new domain. You must replace inside this file all the “http://www.olddomain.tld/sitefolder” occurencies with “https://www.newdomain.tld/newfolder” . Most editors allows you to find & replace words with one click, in order to avoid the search of all occurencies manually.

Download the WP directory and update the wp-config.php file

The next step is to download the WordPress folder and update the “wp-config.php” file, situated in the main folder of your WP installation, with the informations of the new database. You’ll have to update here the database’s URL, user, password, database’s name, and leave unchanged the tables prefix.

define('DB_NAME', 'my_database');
define('DB_USER', 'my_user');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
 
$table_prefix  = 'wp_blog_';

To download your WP folder, you can use an FTP client, like Filezilla.

Upload database and WP folder to the new server

Finally you must upload your database and your WordPress installation folder to the new server.

For the database you’ll have to go to the database management application, to PhpMyAdmin and import the new database’s tables, by uploading your second “.sql” file.

And finally you have to upload the WP folder to the new server using your provider’s web application or an FTP client, like Filezilla.




Hariton Andrei Marius

I'm a computer scientist passionated about a lot of things belonging to the IT world.

No Comments


You can leave the first : )



Leave a Reply

Your email address will not be published. Required fields are marked *