This document describes the approach to migrate WordPress instances running on Linux App Service using different images, or older wordpress-alpine:0.72, to the new WordPress offering image (i.e., mcr.microsoft.com/appsvc/wordpress-alpine-php having
Note-1: The steps described below under section Steps for migrating the docker container will upgrade the underlying stack such as Nginx, PHP, Redis etc., and it will not upgrade/refresh the WordPress version or source code. As a result, sometimes there can be compatibility issue between the upgraded PHP version and underlying WordPress code. So upgrading the WordPress to latest compatible version with the PHP version as per the PHP Compatibility and WordPress Versions is the responsibility of the user.
It is recommended to migrate the WordPress container image first in staging environment, test it thoroughly and then plan for your migration in production environments.
Note-2: Another approach for migration would be to create a new instance of WordPress on Linux App Service from Azure Marketplace and then migrate the content from your existing WordPress site by following the WordPress Migration Guide.
-
Make sure your WordPress code is in /home/site/wwwroot path.
-
Create the following folder /home/wp-locks using SCM site (https://<appname>.scm.azurewebsites.net/newui).
-
Download wp_deployment_status.txt file and upload it to /home/wp-locks folder. This will prevent re-installation of WordPress and deletion of any old data when you migrate to the new image.
-
Take a back-up of your wp-config.php
-
Replace the wp-config.php file located at /home/site/wwwroot with the new file located here
-
Add the additional configurations from your backup wp-config.php file if any, and add any other additional custom configurations you may want to include and save the file.
-
Now launch the Azure Portal and navigate to your App Service definition page.
-
Navigate to Configuration blade and verify the Application Settings. Make sure the following Application Settings are present and configured correctly.
Application Setting Name Value WEBSITES_ENABLE_APP_SERVICE_STORAGE true DATABASE_HOST <actual value> DATABASE_NAME <actual value> DATABASE_PASSWORD <actual value> DATABASE_USERNAME <actual value> -
Navigate to Deployment Center blade and update the new image details with appropriate tag value as shown in the below screen shot.
-
Restart your App Service to take the changes into effect.
-
To cross verify, launch (https://<appname>.scm.azurewebsites.net/newui/webssh)
-
In webssh console, run cat /etc/os-release command. It should show the Alpine version as shown in below screenshot
-
Run php --version command to validate the image is on latest php version as shown below
-
Now Launch the WP-Admin (https://<appname>.azurewebsites.net/wp-admin/)
-
Upgrade WordPress version to latest recommended version as hinted in the Admin UI
-
Alternatively, if you run into any challenges with upgrade in the above step, you can follow the steps described in Manual Updates section of this document.