Comprehensive WordPress Migration Guide
Step 1: Backup All Files
Before starting the migration, you must create a complete backup of your WordPress website files.
- Log in to your hosting cPanel.
- Go to the Domains menu.
-
Locate the domain you want to migrate and click its
Directory Root link.
This automatically opens the correct folder in File Manager. - Once in the domain’s root folder (usually
public_htmlor a subfolder): - Click Select All at the top.
- Right-click anywhere inside the file list.
- Select the Compress option.
- Choose ZIP Archive and confirm.
- Wait until the ZIP file is created.
- Download the resulting ZIP archive to your computer.
-
Make sure the archive contains all important WordPress files, including:
wp-content(themes, plugins, uploads)wp-adminwp-includeswp-config.php- All other root files
- Hidden files like
.htaccess(if visible)
Step 2: Export Your Database
Your WordPress content is stored in a MySQL database. Before exporting it, you must confirm which database your site is using.
- Open File Manager in your hosting cPanel.
- Navigate to the root folder of your WordPress installation.
- Locate the
wp-config.phpfile and open it. -
Inside the file, find the following line:
define('DB_NAME', 'your_database_name');This is the exact database you need to export. - Now go back to cPanel and open phpMyAdmin.
- Select the database identified in the
DB_NAMEline. - Click on Export at the top menu.
- Choose Quick export for simplicity, or
- Custom if you want to review/export specific tables (default settings are usually fine).
- Click Go to download the SQL file to your computer.
Make sure all WordPress tables (usually starting with wp_) are included in the export.
Step 3: Upload Files to the New Host
- Log in to the new hosting cPanel.
- Navigate to File Manager → public_html (or the correct root directory).
- Upload all WordPress files from your backup.
- Extract files if you uploaded a ZIP archive.
Double-check that the folder structure matches the old host.
Step 4: Create a New Database
- In cPanel, go to MySQL Databases.
- Create a new database.
- Create a new user and assign it to the database with all privileges.
- Note the database name, username, and password for wp-config.php.
Ensure the database user has full privileges for smooth migration.
Step 5: Import the Database
- Open phpMyAdmin on the new host.
- Select the newly created database.
- Click Import and upload the SQL file exported from the old host.
- Wait until the import completes and verify that all tables are imported.
Large databases may need chunked import or use of tools like BigDump.
Step 6: Update wp-config.php
- Open
wp-config.phpin the new host’s file manager. - Update the following values to match the new database:
DB_NAMEDB_USERDB_PASSWORDDB_HOST(usuallylocalhost)- Save the file.
Step 7: Test Your Site
- Check your website on the new host using a temporary URL or hosts file trick.
- Verify that all pages, posts, plugins, and media work correctly.
- Look for missing images, broken links, or plugin issues.
After testing, update your domain’s DNS to point to the new host.
Step 8: Optional – Fix Permalinks
- Go to WordPress Dashboard → Settings → Permalinks.
- Click Save Changes to refresh URL structure.
- This ensures internal links work correctly on the new host.
