Search code examples
wordpressazuredatabase-migrationcleardb

Migrate a self-hosted wordpress to MS Azure. Max query threshold exceeded with ClearDB


I would like to migrate a self-hosted wordpress site to Microsoft Azure. I've already done this migration job with Duplicator plugin from a server to another and everything worked well.

The problem with Ms Azure is that it uses a service called ClearDB to manage databases. (feel free to correct me if it's wrong) When you create a free account with this service you will get a restricted plan called Mercury which allows you to query your db (max dimension of 20MB) up to 3600 queries/hour. But the migration process requires several operations on the database and the

As written in this blog the only option is to upgrade your plan to the 10$/month subscription.

I've found another way but the plugin the author uses in this link does not work for me.

Should I use another plugin to backup my WP content? Do you have any advice?

Thanks


Solution

  • There are three solutions. I chose the first one.

    • Configure Mysql on a virtual machine and install Wordpress (classic way)

    This can be done installing an already configured image with the Lamp packages on your Virtual Machine. Please see this link

    If you want to set up it manually, follow these steps:

    Create the vm (I used Ubuntu 14.04) then connect via SSH to your server.

    ssh root@server_ip_address
    

    Install Apache

    sudo apt-get update
    sudo apt-get install apache2
    

    To check if Apache is installed, direct your browser to your server’s IP address. The page should display the words “It works!"

    Install MySQL

    sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
    

    During the installation, MySQL will ask you to set a root password. Once you have installed MySQL activate it with this command:

    sudo mysql_install_db
    

    Finish up by running the MySQL set up script:

    sudo /usr/bin/mysql_secure_installation
    

    The prompt will ask you for your current root password.

    Install PHP

    sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
    

    PHP also has a variety of useful libraries and modules that you can add onto your virtual machine. You can see the libraries that are available.

    apt-cache search php5-
    

    Decide which module you wish to install and type:

    sudo apt-get install name_of_the_module
    

    Although LAMP is installed, we can still take a look and see the components online by creating a quick php info page. Create a new file:

    sudo nano /var/www/info.php
    

    Add in the following line. Save and exit

    <?php
    phpinfo();
    ?>
    

    Finally restart apache

    sudo service apache2 restart
    

    and check the info page typing in your url

    server_ip_address/info.php

    • Install mysql in a VM and create an Azure Website with a Wordpress image. Then link the mysql db on the virtual machine to the Wordpress site.

    • Upgrade ClearDB plan to the 10$/month subscription and specify the url of your remote db in wp-config.php