How to Migrate a WordPress Website to Another Server: Complete Step-by-Step Guide
Migrating a WordPress website from one server to another may sound complicated, but with the right preparation and a systematic approach, the process can be completed safely with minimal downtime.
Whether you are moving to a faster hosting provider, upgrading to a VPS, changing your server location, or moving from shared hosting to cloud hosting, the basic migration process involves transferring WordPress files and the database, configuring the new server, and updating DNS records.
This guide explains several ways to migrate a WordPress website to another server, including manual migration, control-panel tools, and WordPress migration plugins.
What Is WordPress Website Migration?
WordPress migration is the process of moving a complete WordPress website from one hosting server to another.
A typical WordPress website contains two major components:
1. WordPress Files
These include:
- WordPress core files
- Themes
- Plugins
- Media uploads
- Configuration files
- Custom files
.htaccess- Other website files
The most important user-generated files are generally located inside:
wp-content/
2. WordPress Database
The database contains important website information such as:
- Posts
- Pages
- Users
- Comments
- Categories
- Tags
- Plugin settings
- Theme settings
- WooCommerce data
- WordPress configuration stored in the database
A successful migration requires both the files and database to be transferred correctly.
Why Migrate a WordPress Website?
There are many reasons to move a WordPress website to another server.
Common reasons include:
- Better server performance
- More storage
- Additional CPU and RAM
- Improved server configuration
- Better security
- Moving to a VPS
- Changing hosting providers
- Lower hosting costs
- Better technical support
- Moving to a different datacenter
- Scaling an ecommerce website
- Switching from shared hosting to cloud hosting
Migration can also be useful when an existing hosting environment no longer provides the resources your website needs.
Things to Check Before WordPress Migration
Before starting the migration, prepare both the old and new servers.
1. Create a Full Backup
Always create a complete backup before migrating.
Your backup should include:
- WordPress files
- Database
- Email data if required
- DNS records
- SSL configuration
- Cron jobs
- Custom server configuration
Keep at least one copy outside the old server.
For example:
website-backup/
├── wordpress-files.zip
└── database.sql
Do not delete the old website until the new installation has been tested successfully.
2. Check the New Server Requirements
Make sure the new hosting environment supports your website.
Check:
- PHP version
- MySQL/MariaDB version
- Web server
- Available disk space
- RAM
- CPU resources
- SSL support
- Database limits
- PHP memory limit
- Maximum upload size
Also check whether your plugins and themes are compatible with the new PHP version.
3. Record Your Current Configuration
Before migration, note important settings such as:
- Current PHP version
- Database name
- Database username
- PHP memory limit
- Cron jobs
- Email configuration
- DNS records
- CDN configuration
- Caching configuration
- SSL setup
- Firewall/security settings
This makes troubleshooting much easier if something behaves differently after migration.
Method 1: Migrate WordPress Using a Migration Plugin
Using a WordPress migration plugin is one of the easiest methods for beginners.
Popular migration plugins include:
- Duplicator
- All-in-One WP Migration
- UpdraftPlus
- Migrate Guru
The exact interface and limits vary between plugins and plans.
Step 1: Install a Migration Plugin
Log in to your WordPress dashboard:
https://example.com/wp-admin
Go to:
Plugins → Add New Plugin
Search for a trusted migration or backup plugin and install it.
Activate the plugin.
Step 2: Create a Migration Package
Most migration plugins can package your website into an archive.
Depending on the plugin, the package may contain:
WordPress Files
+
Database
+
Migration Configuration
Follow the plugin’s instructions to create the package.
For larger websites, the backup/archive may take some time.
Step 3: Prepare WordPress on the New Server
Create the domain on your new hosting account.
For example:
example.com
Make sure the domain points to the correct website directory.
Depending on your hosting control panel, this might be called:
- public_html
- domains/example.com/public_html
- httpdocs
- web root
Step 4: Upload the Migration Package
Upload the migration files to the new server.
You can use:
- File Manager
- FTP
- SFTP
- SSH
For large files, SFTP or SSH can be more reliable than browser-based uploads.
Step 5: Restore the Website
Follow the migration plugin’s restoration process.
The plugin may automatically:
- Create/import the database
- Extract WordPress files
- Configure the installation
- Update URLs
- Complete the migration
After restoration, test the website before changing DNS.
Method 2: Manually Migrate WordPress
Manual migration provides greater control and is particularly useful for administrators, VPS users, and hosting providers.
The process consists of:
- Backup WordPress files
- Export the database
- Create a database on the new server
- Upload WordPress files
- Import the database
- Configure
wp-config.php - Update URLs if required
- Test the website
- Change DNS
Let’s go through each step.
Step 1: Put the Website in Maintenance Mode
For websites that receive frequent updates, consider temporarily enabling maintenance mode during the final migration.
This prevents new content from being created on the old website while the final database is being copied.
For example, if visitors can place orders on a WooCommerce website, continuing to use the old website during migration can result in missing orders or customer data.
For high-traffic websites, consider performing an initial migration first and then a final synchronized database migration during a short maintenance window.
Step 2: Backup WordPress Files
You can create a compressed archive using your hosting control panel or SSH.
For example:
tar -czf wordpress-files.tar.gz public_html/
Alternatively, create a ZIP archive through File Manager.
Make sure the backup includes:
wp-admin/
wp-content/
wp-includes/
wp-config.php
.htaccess
index.php
and the remaining WordPress files.
Step 3: Export the WordPress Database
You can export the database using phpMyAdmin or the command line.
Using phpMyAdmin
- Log in to phpMyAdmin.
- Select the WordPress database.
- Click Export.
- Select the appropriate export method.
- Choose SQL format.
- Download the database file.
You may receive a file such as:
wordpress.sql
For larger databases, command-line tools can be more efficient.
For example:
mysqldump -u database_user -p database_name > wordpress.sql
Enter the database password when prompted.
Step 4: Create a Database on the New Server
Create a new MySQL or MariaDB database on the destination server.
You will typically need:
Database Name
Database Username
Database Password
Database Host
For example:
Database: newsite_db
User: newsite_user
Password: ********
Host: localhost
Make sure the database user has sufficient privileges on the database.
Step 5: Upload WordPress Files to the New Server
Upload the WordPress archive to the new server.
Using SSH, you can extract an archive with:
tar -xzf wordpress-files.tar.gz
Make sure the files are placed in the correct document root.
For example:
public_html/
or the document root configured for your domain.
Step 6: Import the WordPress Database
You can import the database using phpMyAdmin.
Select the newly created database and choose:
Import → Choose File → Import
Select:
wordpress.sql
and start the import.
For large databases, SSH may be more suitable:
mysql -u newsite_user -p newsite_db < wordpress.sql
Step 7: Update wp-config.php
Open:
wp-config.php
Find the database configuration:
define( 'DB_NAME', 'database_name' );
define( 'DB_USER', 'database_user' );
define( 'DB_PASSWORD', 'database_password' );
define( 'DB_HOST', 'localhost' );
Replace the values with the database information from the new server.
For example:
define( 'DB_NAME', 'newsite_db' );
define( 'DB_USER', 'newsite_user' );
define( 'DB_PASSWORD', 'your-password' );
define( 'DB_HOST', 'localhost' );
Do not change other settings unless necessary.
Step 8: Check the Site URL
If the domain name remains unchanged, you generally don’t need to change the WordPress URL just because the server has changed.
WordPress usually stores the site’s URL in the database.
You can check it under:
Settings → General
Look for:
WordPress Address (URL)
Site Address (URL)
For example:
https://example.com
If the domain itself is changing, additional URL replacement is required.
Migrating WordPress to a New Domain
Moving to a new server while keeping the same domain is simpler.
However, moving from:
oldexample.com
to:
newexample.com
requires additional steps.
WordPress may contain the old domain in:
- Database records
- Post content
- Image URLs
- Plugin settings
- Theme settings
- Widgets
- Serialized data
Avoid performing a simple global search-and-replace directly on the SQL file because serialized WordPress data can be damaged by incorrect replacements.
Use a WordPress-aware search-and-replace tool or WP-CLI.
For example:
wp search-replace 'https://oldexample.com' 'https://newexample.com' --all-tables
Always create a database backup before performing a search-and-replace operation.
Step 9: Configure SSL on the New Server
Before switching visitors to the new server, configure HTTPS.
Depending on your hosting environment, you can use:
- Let’s Encrypt
- Commercial SSL certificate
- Hosting control panel SSL tools
- CDN-provided SSL
After SSL installation, verify:
https://example.com
works correctly.
Check for mixed-content warnings as well.
Step 10: Test the Website Before Changing DNS
This is one of the most important migration steps.
Do not immediately change DNS.
First test:
- Homepage
- Posts
- Pages
- Images
- Login
- WordPress dashboard
- Contact forms
- Search
- Comments
- Plugins
- Theme functionality
- WooCommerce
- Checkout
- User registration
- Email functionality
- Cron jobs
- SSL
- Redirects
Also test the website on mobile devices.
How to Test the New Server Before DNS Changes
You can temporarily test the website by using a local hosts-file entry or another controlled testing method.
For example, your computer can temporarily resolve:
example.com → NEW_SERVER_IP
This allows you to test the new server without changing public DNS.
Once everything works correctly, remove the temporary override.
Step 11: Change DNS Records
Once the new server is ready, update the DNS records.
For an A record, you might have:
Type: A
Name: @
Value: NEW_SERVER_IP
For www, you might use:
Type: CNAME
Name: www
Value: example.com
Your exact DNS configuration depends on your domain and DNS provider.
How Long Does DNS Migration Take?
DNS changes do not necessarily become visible everywhere immediately.
The actual transition time depends on:
- DNS TTL
- DNS provider
- ISP resolvers
- Local caching
- Recursive DNS caching
During the transition period, some visitors may reach the old server while others reach the new server.
Therefore, keep the old server online until you are confident that traffic has moved to the new server.
Step 12: Verify DNS Resolution
Use DNS lookup tools or command-line utilities to check the domain.
For example:
dig example.com
or:
nslookup example.com
Verify that the domain resolves to the new server’s IP address.
Step 13: Monitor the New Server
After DNS changes, monitor the website carefully.
Check:
- Server CPU usage
- RAM usage
- Disk usage
- Error logs
- PHP errors
- Web server logs
- Database errors
- 404 errors
- SSL errors
- Email delivery
- Cron jobs
- Website uptime
Pay particular attention to ecommerce websites and websites with user-generated content.
WordPress Migration With DirectAdmin
If your destination server uses DirectAdmin, the migration process can be simplified.
Depending on your hosting setup, you can use DirectAdmin’s account backup/restore functionality to transfer an account.
A typical workflow is:
- Create a backup on the old server.
- Download or transfer the backup.
- Create or restore the account on the new DirectAdmin server.
- Restore the account data.
- Verify files and databases.
- Check domain configuration.
- Install SSL.
- Test the website.
- Update DNS.
For DirectAdmin-to-DirectAdmin migrations, account-level backup and restore can be significantly easier than manually transferring every WordPress component.
WordPress Migration With cPanel
For cPanel-based hosting, a similar account migration can be performed using cPanel backups or account-transfer functionality, depending on the access level available.
If you have full WHM/root access, an entire hosting account can often be transferred rather than migrating WordPress manually.
This may preserve additional account-level configuration such as:
- Website files
- Databases
- Email accounts
- DNS configuration
- Cron jobs
- SSL-related settings
The exact options depend on the source and destination hosting environments.
Migrating WordPress Email Accounts
A common mistake is migrating the website but forgetting email.
If your domain uses hosting-server email such as:
[email protected]
[email protected]
[email protected]
you need to consider:
- Email accounts
- Mailbox contents
- Forwarders
- Autoresponders
- MX records
- SPF
- DKIM
- DMARC
If email is hosted by an external provider such as Google Workspace or Microsoft 365, do not unnecessarily move the mailboxes to the new web server.
Instead, preserve the existing mail-related DNS records.
Update SPF, DKIM and DMARC
After migration, verify your domain’s email authentication records.
Common DNS records include:
SPF
DKIM
DMARC
If the new server will send email for the domain, its sending IP may need to be included in the SPF configuration.
DKIM keys may also need to be configured on the new mail server.
Incorrect email DNS configuration can cause messages to be rejected or delivered to spam folders.
Fix WordPress Permalinks After Migration
Sometimes WordPress pages return:
404 Not Found
after migration.
A common solution is to regenerate permalink rules.
Go to:
WordPress Dashboard → Settings → Permalinks
Simply click:
Save Changes
You don’t necessarily need to change the permalink structure.
This can regenerate the rewrite configuration.
Check the .htaccess File
If your website uses Apache, check:
.htaccess
A typical WordPress .htaccess configuration may look like:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Do not blindly replace an existing .htaccess file because plugins or custom configurations may have added additional rules.
Clear WordPress and Server Caches
After migration, clear all relevant caches.
These may include:
- WordPress page cache
- Object cache
- Browser cache
- CDN cache
- Server cache
- PHP opcode cache
If your website uses Redis or Memcached, verify that the new server’s configuration matches the WordPress caching setup.
Check File Permissions
Incorrect file permissions can cause:
- 403 errors
- Plugin installation failures
- Upload failures
- Theme update problems
- Security issues
The appropriate permissions depend on your server configuration and PHP execution model.
Avoid applying overly permissive permissions such as:
777
to your WordPress files and directories.
Common WordPress Migration Problems
1. Error Establishing a Database Connection
This usually indicates a database configuration or connectivity problem.
Check:
DB_NAME
DB_USER
DB_PASSWORD
DB_HOST
Also verify that the database user has access to the database.
2. Internal Server Error
An HTTP 500 error may be caused by:
- Incorrect
.htaccess - PHP errors
- Incompatible PHP version
- Plugin problems
- Theme problems
- Incorrect permissions
- Server configuration
Check the web server and PHP error logs.
3. Images Are Missing
If images don’t load after migration, check:
wp-content/uploads/
Make sure the directory was transferred correctly.
If the domain changed, also check whether image URLs still reference the old domain.
4. WordPress Redirects to the Old Server
This can happen when:
- DNS still points to the old server
- WordPress URL configuration is incorrect
- A caching layer contains old information
- Redirect rules reference the old domain/server
Check WordPress URL settings, DNS records, .htaccess, and caching systems.
5. Plugins Stop Working
A plugin may fail because of:
- Different PHP version
- Missing PHP extension
- File permission problems
- Server configuration differences
- Plugin conflicts
- Object-cache differences
Check the WordPress debug log and server logs.
How to Migrate a Large WordPress Website
Large websites require additional planning.
For example, a website with:
100 GB+ files
Large database
Thousands of users
High traffic
WooCommerce orders
should not necessarily be migrated using a browser-based backup upload.
Consider:
- SSH
rsyncmysqldump- Database import through command line
- Staged migration
- Temporary maintenance mode
- Incremental synchronization
For example, rsync can synchronize files efficiently:
rsync -avz /source/path/ user@new-server:/destination/path/
For large databases, command-line MySQL tools are generally more practical than phpMyAdmin.
How to Minimize WordPress Migration Downtime
For a busy website, use a staged migration.
Phase 1: Prepare
Set up the new server and install the required software.
Phase 2: Initial Transfer
Copy WordPress files and database to the new server.
Phase 3: Test
Test the website thoroughly on the new server.
Phase 4: Lower DNS TTL
If appropriate, lower the DNS TTL before the planned migration.
Phase 5: Final Synchronization
Temporarily stop new changes on the old website and synchronize any new files/database changes.
Phase 6: DNS Update
Point the domain to the new server.
Phase 7: Monitor
Keep the old server available while DNS changes propagate and verify that the new environment is working correctly.
Special Considerations for WooCommerce
WooCommerce websites require extra care.
A store may receive new:
- Orders
- Customers
- Payments
- Reviews
- Product updates
while migration is taking place.
If you simply copy the database at one point in time and then allow the old store to continue accepting orders, new orders created afterward may not exist on the migrated database.
For ecommerce websites, plan a short maintenance window or use a migration strategy that accounts for ongoing database changes.
SEO Considerations During WordPress Migration
Changing servers alone does not require changing your URLs.
If the domain and URL structure remain the same, focus on maintaining:
- URLs
- Metadata
- Canonical tags
- XML sitemap
- Robots.txt
- Internal links
- Redirects
- HTTPS
- Structured data
After migration, check Google Search Console for:
- Indexing issues
- Crawl errors
- HTTPS problems
- Server errors
- Unexpected URL changes
If the domain or URL structure changes, create appropriate 301 redirects from old URLs to their corresponding new URLs.
WordPress Migration Checklist
Before declaring the migration complete, verify the following:
Backup
- WordPress files backed up
- Database backed up
- Email data considered
- DNS records documented
New Server
- Domain configured
- PHP version checked
- Database created
- WordPress files uploaded
- Database imported
wp-config.phpupdated- SSL installed
Testing
- Homepage works
- Admin login works
- Pages work
- Posts work
- Images load
- Forms work
- Plugins work
- Theme works
- WooCommerce tested
- Email tested
- Permalinks tested
DNS
- A record updated
- CNAME records checked
- MX records checked
- SPF checked
- DKIM checked
- DMARC checked
- DNS propagation monitored
After Migration
- Error logs checked
- Website speed tested
- Cache cleared
- Search Console checked
- Monitoring enabled
- Old server retained temporarily
Best Practices for WordPress Server Migration
Follow these practices to make the migration safer:
- Always create a complete backup first.
- Test the new server before changing DNS.
- Keep the old server available during the transition.
- Use SSH/SFTP for large websites when possible.
- Check PHP and database compatibility.
- Verify SSL before switching traffic.
- Don’t forget email and DNS records.
- Test forms and transactional email.
- Regenerate permalinks if required.
- Clear caches after migration.
- Monitor logs after DNS changes.
- For ecommerce websites, plan the database cutover carefully.
Frequently Asked Questions
Can I migrate WordPress without changing the domain?
Yes. You can move the website to a new server while keeping the same domain name. In that case, the main DNS change is usually pointing the domain to the new server.
Will my WordPress website go offline during migration?
Not necessarily. With careful planning, you can perform most of the migration while the existing website remains online and then switch DNS after testing the new server.
Do I need to reinstall WordPress on the new server?
Not always. You can transfer the existing WordPress files and database. Alternatively, migration plugins and hosting migration tools can automate much of the process.
What happens to my WordPress database during migration?
The database must be exported from the old server and imported into the new server, unless your migration tool transfers it automatically.
Can I migrate WordPress manually?
Yes. Manual migration involves transferring the WordPress files, exporting/importing the database, updating database credentials, configuring the server, and testing the website.
Should I delete the old hosting account immediately?
No. Keep the old hosting account available until you have confirmed that the website, DNS, email, and other services are working correctly on the new server.
Can I migrate WordPress to a VPS?
Yes. WordPress can be migrated from shared hosting to a VPS, cloud server, or dedicated server. However, the VPS must be correctly configured with a web server, PHP, database server, SSL, firewall, backups, and other required services.
Conclusion
Migrating a WordPress website to another server involves more than simply copying website files. A complete migration requires the WordPress files, database, domain configuration, SSL, DNS, email settings, and server environment to work together correctly.
For small websites, a migration plugin can simplify the process. For larger or more complex websites, manual migration using tools such as SSH, rsync, and mysqldump can provide greater control.
The most important rule is simple: backup first, test the new server before changing DNS, and keep the old server available until the migration has been verified.
With proper planning, you can move a WordPress website to a new hosting server with minimal downtime and without losing important website data.