How to Manually Migrate a WordPress Website
Old Site
Backup wp-content Directory
This directory contains all the
- Themes
- Plugins
- Uploads
Login to your hosting server and create a zip of the wp-content folder
CPanel
Files>File Manager>wp-content compress download
Backup wp-config.php File
This file holds the configuration of how the website connects to the DataBase
CPanel
Files>File Manager>wp-config.php download
Backup DataBase
The DataBase holds all the pages, posts, users and configurations.
CPanel
DataBases>phpMyAdmin
Select the desired DataBase.
If the DataBase name is not obvious then refer to the wp-config.php (Old Site)
file as it will be pointing to it
Example: define(‘DB_NAME’, ‘wp_wrdp9’);
Check All
Format: SQL
Export
Backup Complete
At this stage you should have 3 files
- wp-content.zip
- wp-config.php
- database.sql
New Site
Deploy WordPress Website
Deploy a new WordPress Web Site either manually or using any automated install offered by the hosting provider. As we will be restoring over the top of most of it.
How to Setup a WordPress Website on Debian Based Linux
Restore wp-content Directory
CPanel
Files>File Manager>wp-content
Delete: wp-content
Upload: wp-content.zip
Extract: wp-content.zip
Delete: wp-content.zip
Edit wp-config.php File
Update the following lines to point to the new DataBase
define('DB_NAME', 'wordpress_db');
/** MySQL database username */
define('DB_USER', 'wordpress_db');
/** MySQL database password */
define('DB_PASSWORD', 'wordpress_db');
/** MySQL hostname */
define('DB_HOST', 'localhost');
$table_prefix = 'wp_';
Restore DataBase
CPanel
DataBases>phpMyAdmin
Select the desired DataBase.
Again if the DataBase name is not obvious then refer to the wp-config.php (New Site)
file as it will be pointing to it
Example: define(‘DB_NAME’, ‘wp_wrdp1’);
Check All
Drop
Import
Choose File
database.sql
Import
Go into the options table and modify field values for
- siteurl
- home
From: http://oldsite.com
To: http://www.newsite.com
Update URL Link References
If you are migrating the hosting only then skip this step.
If you are migrating to a new URL you will need to do a find and replace of all references the the old URL. All your images etc. are at this stage still being pulled from the old location
Manually
Coming Soon
Plugin
Cleanup
Do not forget to clean up the old hosting environment.
- Uninstall WordPress
- Delete Files
- Drop the Database
Related
- Setup a WordPress Website on Debian Based Linux
- AWS Essentials
- ~/.ssh/config Essentials
- /etc/ssh/sshd_config Essentials
- Working With SSH Keys
- Rsync Essentials
Links
- https://wordpress.org/
- https://wordpress.org/plugins/velvet-blues-update-urls/