Not long ago I transfer WordPress files on one of my websites to a new domain and hosting. Initially confused me, because some database files must be updated. Here I will share brief tips on how to move WordPress files to a new domain name or local server.
How To Transfer WordPress Files To New Domain Name
- Backup all WordPress files from old hosting.
- Backup the database on the old hosting.
- Create a new database, username, and password on new hosting and restore the old database.
- Restore all WordPress files to new hosting.
- Edit the database name, username, and password settings in the wp-config.php file.
- Update some table contents using the following SQL syntax
# Backup all WordPress files from old hosting
Open your Cpanel hosting and compress all your WordPress files into Zip file and download
# Backup the database on the old hosting
Export database to .sql extension via phpmyadmin
# Create a new database, username, and password on the new hosting and restore the old database.
# Restore all WordPress files to the new hosting (Extract all the files on the new hosting)
# Edit the name of database, username, and password settings in the wp-config.php file
# update some contents of the table using the following SQL syntax
1 2 3 4 5 | UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,'http://old-example.com','http://new-example'); UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://old-example.com', 'http://new-example'); UPDATE wp_options SET option_value = REPLACE(option_value, 'http://old-example.com', 'http://new-example') WHERE option_name = 'home' OR option_name = 'siteurl'; |
Thus my 6 step how to How To Transfer WordPress Files To New Domain Name And Hosting. Hope useful
Leave a Reply