How to Migrate a WordPress Site Step by Step
Print- Cómo Migrar un Sitio WordPress
- 5463
How to Migrate a WordPress Site Step by Step
Migrating a WordPress site from one server to another or from one domain to another can seem complicated, but by following the proper steps, you can do it safely and efficiently. Here's a step-by-step guide to help you through the process.
Before You Begin
-
Create a complete backup of your site (both files and database). This is crucial to avoid any loss of information in case something goes wrong.
-
Access to both servers (the source and the destination) or your hosting control panel (cPanel, Plesk, etc.).
Step 1: Preparing the Source Site
1.1. Backup the Site Files
Access your server via FTP/SFTP or use your cPanel file manager. Download all the files from your WordPress installation:
-
wp-content (contains themes, plugins, and media)
-
wp-config.php (database configuration)
-
.htaccess (if it exists)
1.2. Export the Database
Access phpMyAdmin from cPanel or through your hosting and do the following:
-
Select the WordPress database.
-
Click on the Export tab.
-
Choose the SQL format and click Go to download the database file.
Step 2: Prepare the New Server or Domain
2.1. Install WordPress on the New Server
If you haven't installed WordPress on the new server yet:
-
Install a fresh copy of WordPress on the new server or domain, ensuring it’s in a blank state.
-
Create a new database on the destination server and take note of the access credentials (database name, username, password, and database host).
2.2. Upload the Site Files
Use FTP or the file manager in cPanel to upload the files from the wp-content folder to the new server in the same directory where you installed WordPress. Make sure to overwrite the files if prompted.
Step 3: Import the Database
3.1. Upload the Database
Access phpMyAdmin on the destination server, select the new database you created, and click on the Import tab.
-
Select the .sql file you downloaded from the source server.
-
Click Go to import the database.
3.2. Update wp-config.php File
On the destination server, open the wp-config.php file and update the following values with the new database information:
define('DB_NAME', 'your_new_database_name');
define('DB_USER', 'your_new_database_user');
define('DB_PASSWORD', 'your_new_database_password');
define('DB_HOST', 'localhost'); // Or the appropriate host
Step 4: Update URLs in the Database
If you’ve changed domains or URLs, you need to update the URLs in the database to point to the new domain or address.
-
Open phpMyAdmin on the destination server.
-
Select the WordPress database.
-
Run the following SQL query to update the URLs:
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
-
Then, run the following query to update internal links:
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldsite.com','http://www.newsite.com');
Step 5: Test the Site on the New Server
-
Visit the new domain or IP address and check that everything is working correctly. Ensure images, internal links, and plugins are functioning properly.
-
If you find any broken links or missing content, check the file permissions and database settings.
Step 6: Clear Cache and Update Permalinks
-
Clear the cache if you are using any caching plugin.
-
Update the permalinks to make sure your post and page URLs are correctly configured:
-
Go to Settings > Permalinks in the WordPress dashboard.
-
Simply click Save Changes.
-
Step 7: Remove the Source Site (Optional)
Once you've confirmed that everything is working correctly on the new server and that all data has been successfully migrated, you can delete the files from your old site if you no longer need them.
Congratulations! You've successfully migrated your WordPress site to a new server or domain. Migrating WordPress can be straightforward if you follow these steps carefully. Always remember to make backups before making any major changes to your site.
If you need further assistance, feel free to ask. Good luck with your migration!

ID Tax. EIN 32-0774429 US