Migrating a WordPress website to a new hosting provider or web server can be daunting for many WordPress users. This is understandable since a poorly executed WordPress migration can trigger adverse effects such as downtime and data loss. Fortunately, migrating a WordPress site to another WordPress deployed to Linux App Services, preferably created from Azure Market Place the right way isn’t as complicated as you might think. In addition to the manual method, many tools are available that can help automate most of the process, ensuring a smooth and secure migration.
You can migrate your site to WordPress on Azure App Service in three ways:
Note: Migrate the content to a test instance first, validate all E2E scenarios of your website, and if everything works as expected, swap this instance to the production slot.
WordPress migration tool for app services is a one-click service to migrate a WordPress site hosted on Windows Azure App Service to a WordPress site hosted on Linux App Service. You can download the WordPressMigrationTool.zip from this link to your local machine and extract the zip file. Please follow the steps described in this document for instructions on how to use the tool.
This is a very popular and trusted plugin used for migrating sites with ease and is also recommended by the Azure WordPress team. However, there are certain things that need to be taken care of before starting on the WordPress migration.
This approach is recommended for smaller sites where the content size is less than 256MB. If it is more, you can either purchase the premium version of the plugin, which allows you to bypass the file upload limit, or you can manually migrate the site using the steps outlined in the next section.
By default, the file upload size for WordPress on Linux App Services is limited to 50MB, and it can be increased up to 256MB (Maximum Limit). To change the file upload size limit, you need to add the following Application Settings in the App Service and save it.
Application Setting Name | Default Value | New Value |
---|---|---|
UPLOAD_MAX_FILESIZE | 50M | 256M |
POST_MAX_SIZE | 128M | 256M |
If you choose to migrate the site using this plugin, install All-In-One Migration plugin on both source and target sites.
After the site migration, it is better to validate that you have the default recommended/ equivalent plugins activated and configured in the right way. If your site rules do not allow to run these plugins, then you can remove the plugins.
The W3TC plugin should be activated and configured to use the local Redis cache server and Azure CDN/Blob Storage (if it was configured to use them originally). For more information on how to configure these, please refer to the following documentations:
Local Redis Cache, Azure CDN, Azure Blob Storage.
WP Smush plugin is activated and configured for image optimization. Please see Image Compression for more information on configuration.
The following WordPress settings are recommended. However, when the users migrate their custom sites, is it up to them to decide whether to use these settings or not.
The prerequisite is that the WordPress on Linux Azure App Service must have been created with an appropriate hosting plan from here: WordPress on Linux App Service.
Download the wp-content folder from the source site. You can use popular FTP tools like FileZilla to connect to the web server and download the content. Depending on the size of your content, it could take sometime. Meanwhile, you can go to the next step to download a copy of your database.
Export the contents of the source database into an SQL file. You can perform this task either using MySQL client tools like HeidiSQL, MySQL workbench, PhpMyAdmin or through command line interface. You can download the MySQL Workbench from here or install phpmyadmin using these steps. For more information on exporting the database, please refer to the following documentation.
Go to SCM site of your WordPress App Service using the following URL.
https://<sitename>.scm.azurewebsites.net/newui
Open Bash Shell from the menu shown on the top.
Delete the existing content of /home/site/wwwroot/wp-content folder using the following command.
rm -rf /home/site/wwwroot/wp-content/*
Now upload the new contents of wp-content folder using the File Manager. Click on the label that says 'Drag a File/Folder here to upload, or click to select one'. Please note that if you are not able to upload everything at once, then you can try dividing your upload into multiple smaller ones.
You can integrate your WordPress site to use an existing MySQL database, or use the steps below to migrate the content to the new database server created by the WordPress on Linux App Services offering.
Launch the Azure Portal and navigate to your App Service -> Configuration blade. Update the database name in the Application Settings of App Service and save it. This will restart your App and the new changes will get reflected.
Application Setting Name | Update Required? |
---|---|
DATABASE_NAME | Yes, replace with the source (exported) database name |
DATABASE_HOST | Not Required |
DATABASE_USERNAME | Not Required |
DATABASE_PASSWORD | Not Required |
Reference: WordPress Application Settings
After the site migration, it is better to validate that you have the default recommended plugins activated and configured right as before. If your site policies do not allow these plugins, then you can remove the plugins from WP-Admin site.
The W3TC plugin or equivalent should be activated and configured to use the local Redis cache server and Azure CDN/Blob Storage (if it was configured to use them originally). For more information on how to configure these, please refer to the following documentations:
Local Redis Cache, Azure CDN, Azure Blob Storage.
WP Smush plugin is activated and configured properly for image optimization. Please see Image Compression for more information on configuration.
The following WordPress settings are recommended:
Some of the plugins like Woocommerce configured on your website may require specific php libraries and those libraries might not be available out of the box on WordPress environments. Enable the needed php extension to your runtime.
One common issue that users face during migration is that some of the contents of their old site use absolute urls/paths instead of relative ones. To resolve this issue, you can use plugins like Search and Replace to update the database records.
If you plan to setup your site with a new Custom Domain please follow the steps described here: Tutorial: Map existing custom DNS name - Azure App Service | Microsoft Docs
When you migrate a live site and its DNS domain name to App Service, that DNS name is already serving live traffic. You can avoid downtime in DNS resolution during the migration by binding the active DNS name to your App Service app pre-emptively as per the steps described here: Migrate an active DNS name - Azure App Service | Microsoft Docs
If your site is configured with SSL certs, then we need to redo the setup following the instructions here: Add and manage TLS/SSL certificates - Azure App Service | Microsoft Docs
In case you need any support, you can open a support request at New support request - Microsoft Azure.
If you have any ideas about how we can make WordPress on Azure App Service better, please post your ideas at Post idea · Community (azure.com)
For any further support in migrating your WordPress site you could email us at wordpressonazure@microsoft.com to start a conversation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.