none
Wordpress database capacity on Azure Websites RRS feed

  • Question

  • I am wanting to run a Wordpress blog on Azure Websites, but when installing from the gallery, the only option is to use a MySQL database.  According to the pricing page, this is provisioned as a 20MB database (which is not big enough to hold more than a few posts).  Other than the complete lack of MySQL management tools mentioned here, is there any option of using SQL Server for the database rather than MySQL? Is there any way to expand the capacity of the MySQL database?
    Monday, July 23, 2012 6:01 AM

Answers

  • Hi Smearp,

    In another thought, I believe you should be able to convert to  SQL Azure instead of MySQL with Wordpress.

    1. Install your Word Press site from the gallery using Windows Azure Websites.
    2. Once it’s installed – DO NOT Browse and try to configure the site yet.
    3. Download and extract the Word Press DB abstraction for SQL server on your local machine from http://downloads.wordpress.org/plugin/wordpress-database-abstraction.1.1.4.zip
    4. Now connect to your newly created Windows Azure Websites using your favorite FTP client and go to the site root.

    5. Now, browse to the files extracted in step 3 on your local machine and Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins folder in Windows Azure Websites using the FTP client where you have the connection open. This should be parallel to your regular plugins directory. If the mu-plugins directory does not exist, you must create it.

    6. Put the db.php file from inside the wp-db-abstraction directory to wp-content/db.php

    7. Make sure to backup and delete wp-config.php file from wwwroot folder of your windows azure website. This is very important or you will run into issues later in the document.

    8. Now create a Linked resource of SQL Azure from your windows Azure Website. Please follow the steps from portal help on how to create the linked resource.

    9. Go to the property of newly created SQL Azure linked resource and note down, the name of the database, the server name, user name and password. This will be used in later stages.

    10. Now browse to your Windows Azure Website and append the URL with /wp-content/mu-plugins/wp-db-abstraction/setup-config.php

    11. For example, if your site name is http://wponsqlazure.azurewebsites.net/ then it will look something like, http://ajwponsqlazure.azurewebsites.net/wp-content/mu-plugins/wp-db-abstraction/setup-config.php

    12. Follow wizard for Wordpress with Wordpress Database Abstraction Plugin.This will generate new wp-config.php file for you.

    13. Insert SQL Azure DB information that was created in Step 9. Please note to append the Database Host name with “.database.windows.net”  

    14. Now follow the install steps and your word press site is ready to use SQL Azure

    15. You can unlink MySQL server from the linked resources now. Please do not click on delete button, as it doesn’t delete the database, but it deletes the site instead.

    HTH

    Thank you

    Mourad

    Wednesday, July 25, 2012 5:57 PM
    Answerer

All replies

  • Hi smearp

    For expanding MySQL database capacity, please contact ClearDB that support this service.  

    It does not look like you can change the database to SQL server, but I am not 100% sure. This is just my observation while installing wordpress that the only available option is MySQL.   

    Thank you

    Mourad

    Monday, July 23, 2012 8:04 PM
    Answerer
  • Hi Smearp,

    In another thought, I believe you should be able to convert to  SQL Azure instead of MySQL with Wordpress.

    1. Install your Word Press site from the gallery using Windows Azure Websites.
    2. Once it’s installed – DO NOT Browse and try to configure the site yet.
    3. Download and extract the Word Press DB abstraction for SQL server on your local machine from http://downloads.wordpress.org/plugin/wordpress-database-abstraction.1.1.4.zip
    4. Now connect to your newly created Windows Azure Websites using your favorite FTP client and go to the site root.

    5. Now, browse to the files extracted in step 3 on your local machine and Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins folder in Windows Azure Websites using the FTP client where you have the connection open. This should be parallel to your regular plugins directory. If the mu-plugins directory does not exist, you must create it.

    6. Put the db.php file from inside the wp-db-abstraction directory to wp-content/db.php

    7. Make sure to backup and delete wp-config.php file from wwwroot folder of your windows azure website. This is very important or you will run into issues later in the document.

    8. Now create a Linked resource of SQL Azure from your windows Azure Website. Please follow the steps from portal help on how to create the linked resource.

    9. Go to the property of newly created SQL Azure linked resource and note down, the name of the database, the server name, user name and password. This will be used in later stages.

    10. Now browse to your Windows Azure Website and append the URL with /wp-content/mu-plugins/wp-db-abstraction/setup-config.php

    11. For example, if your site name is http://wponsqlazure.azurewebsites.net/ then it will look something like, http://ajwponsqlazure.azurewebsites.net/wp-content/mu-plugins/wp-db-abstraction/setup-config.php

    12. Follow wizard for Wordpress with Wordpress Database Abstraction Plugin.This will generate new wp-config.php file for you.

    13. Insert SQL Azure DB information that was created in Step 9. Please note to append the Database Host name with “.database.windows.net”  

    14. Now follow the install steps and your word press site is ready to use SQL Azure

    15. You can unlink MySQL server from the linked resources now. Please do not click on delete button, as it doesn’t delete the database, but it deletes the site instead.

    HTH

    Thank you

    Mourad

    Wednesday, July 25, 2012 5:57 PM
    Answerer
  • I've run this process, and it mostly works - I was able to get a Wordpress site running on Azure connected to a linked SQL Azure database, but the home page doesn't list any posts, and some of the other plugins don't seem to work either (like wiki).  The data is in the database, but something just doesn't seem to be linking up right.  This is the default page, right after the install.

    

    Monday, September 24, 2012 5:32 PM
  • Hi all,

    Following the 15 steps mouradl mentioned, gives me some troubles at step 9. It doesn't exactly state what type of Linked Resource I should create. I've created an SQL database and wrote down all connection-settings. When I login to the 'previous portal' I can perform a successful connection test to the database and I can also connect to the database directly (https://xxxxxxxxx.database.windows.net/?langid=en-GB#$database=dbname) (Firewall rules were created).

    When I proceed to step 13, I can't connect to the database, whatever value I type in every single input. Can someone please help me out here? I would like to know the exact format for each inputfield.

    The connection settings I'm using now:

    Database Name: <correct databasename>
    User Name: <correct username>
    Password: <correct password>
    Database Host: xxxxxxxx.database.windows.net
    Database Type: I reckon this should be "SQL Server using...", but I've also tried every other option
    Table Prefix: whatever-value

    When clicking Submit, it takes about 20 seconds trying to establish the connection and then it shows 
    "Error establishing a database connection"

    Connecting to the server through FTP shows that no wp-config.php is created, so it seems at step 12 something isn't right.

    Any help would be appreciated. Thanks already for reading!

    Best regards,
    Menno


    • Edited by Menno79 Tuesday, October 16, 2012 8:55 AM
    Tuesday, October 16, 2012 8:54 AM
  • I have had problems as well - some of the things I've found are

    1.  Make sure you copy or move the db.php file into the wp-content folder from the wp-db-abstractions folder.  I usually move it.

    2.  Use PDO SQL Server - I could never get the SQL Server for PHP to work.

    3.  Make sure you use username@databasename format for username

    Also, re my question above, there is a problem in the translations file in a regex that was causing that.  I'll look up the answer I found and post it here if you have that problem as well.

    EDIT:  3: should be username@databaseSERVERname



    • Edited by RJRapson Thursday, October 18, 2012 7:01 PM
    Tuesday, October 16, 2012 12:52 PM
  • For #2, this is because you don't have MsSQL driver for PHP installed. I think you need the PHP extension PHP_SQLSRV.DLL enable. Give it a try. you can get it from http://docs.gurock.com/testrail-admin/howto-installing-sqlsrv

    and for the regex translation issue, you can view it here. http://wordpress.org/support/topic/plugin-wp-db-abstraction-select-top-0?replies=12

    In mu-plugins\wp-db-abstraction\translations\sqlsrv\translation.php the line 726:

    $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*)(;{0,1})$/is';

    should be changed back as 1.1.3:

    $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*)$/is';

    or you can change it to:  $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*);{0,1}$/is';

    Thursday, October 18, 2012 6:58 PM
  • For #2, this is because you don't have MsSQL driver for PHP installed. I think you need the PHP extension PHP_SQLSRV.DLL enable. Give it a try. you can get it from http://docs.gurock.com/testrail-admin/howto-installing-sqlsrv


    Unfortunately, I'm running it on a shared website instance on Azure - no access to the PHP.ini file for force this load.  Thanks, though.
    Thursday, October 18, 2012 7:18 PM
  • Mikael has an awesome solution using GIT:

    http://mikaelkoskinen.net/wordpress-sql-azure/

    I got this to work after manually running the GIT web page and importing his GIT files. Then I uploaded it to my Azure web site using:

    git push azure master

    Dusty

    BI Goals

    Business Intelligence - Got Goals?

    http://BIGoals.azurewebsites.net   Azure Web Site

    www.facebook.com/bigoals365

    www.twitter.com/BIGoals365  @bigoals365




    Dusty



    Wednesday, January 9, 2013 10:41 PM