projectnami
projectnami copied to clipboard
VM in Azure
Hi. I've just reached out to our I.T. with regards to deploying PN in our company Azure portal. My question is will PN work if our I.T. provided us VM environment running in Azure? As i've tried your one click "deploy to azure" button using a trial account, and it doesn't look like it's using a virtual machine perse hence i'm little confuse if PN will run in a VM.
If it will indeed run. Was wondering what is the minimum VM settings required like what OS it need?
Thanks! -mike
Deploy to Azure creates a Web App and an Azure SQL DB. Every site I personally deal with in production environments use that model (App Service Plans and SQL DB performance levels vary as needed, of course).
You can certainly run it in a VM. The requirements are more on the PHP side of the equation than the OS build. PN will even run on Linux VMs provided that you have PHP 7 or higher and the matching build of the SqlSrv extension loaded. For Windows VMs, we recommend using the Web Platform Installer to load PHP and SqlSrv extension.
Hardware requirements are also dependent on your traffic and performance requirements rather than the software itself. If you are going to run SQL Server locally on the VM, then you need to build around those requirements. Otherwise even 2GB of RAM would be a starting point without SQL.
Thanks Patrick!
Hi Patrick,
Quick question about the Web platform installer. Upon installing that in our VM. Is it just a matter of uploading the PN zip file to appropriate folder? Or there's some more MS SQL setup we need to do? Or better yet, do you have any step by step process on how to deploy PN within VM in Azure?
Thanks so much!
So a quick rundown... You need SQL of some type available (on same server, different server, or use Azure SQL DB), and it needs to be in Mixed Mode Authentication. An empty database needs to be created, and you need a user with dbo access to it. IIS needs to be installed. Use Web Platform Installer to set up PHP 7.2, which should also install the SqlSrv module for PHP Delete everything within the folder C:\inetpub\wwwroot Unpack the ZIP into that same folder Using your browser of choice, try to connect to your VM. The installation should begin. Should be self-explanatory from that point.
Thanks Patrick. Will follow these steps and will report back soon.
I will add another AzureDeploy,json for deploying PN in a VM connecting out to Azure SQL in the coming weeks that will take care of the end to end install of everything
If there is demand, I will also add one where it uses a SQL VM image and installs all prereqs as needed too on a single VM instance (similar to the Wordpress Installs with MySQL)
@kilasuit if you can add the option to install PN on a single VM instance, that would be amazing! Please do let me know if it's coming! Would love to try that out.
@patrickebates just got my VM installed with IIS. I'm about to install Web Platform Installer. Do i select wordpress in there and install it? Or just select PHP7.2 and SqlSrv to install but no wordpress? Also if my MS SQL will be in another server, how do i connect it to my VM so when i install PN, it would know where to point to that database? Thanks!
PHP 7.2 and the SQL drivers. Do not install Wordpress. Just download the latest release of PN and unpack into your C:\inetpub\wwwroot, after you empty that folder first. Then open a browser and connect to your VM to start the installation.
You will enter your DB connection info during setup, including the server address.
On Apr 4, 2019, at 11:21 AM, mikeman23 <[email protected]mailto:[email protected]> wrote:
@patrickebateshttps://github.com/patrickebates just got my VM installed with IIS. I'm about to install Web Platform Installer. Do i select wordpress in there and install it? Or just select PHP7.2 and SqlSrv to install but no wordpress? Also if my MS SQL will be in another server, how do i connect it to my VM so when i install PN, it would know where to point to that database? Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ProjectNami/projectnami/issues/336#issuecomment-479966920, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEJ8JlVEp64Xi3FnxtHzsyH5h4qy5N4Iks5vdiaGgaJpZM4cB-r8.
@patrickebates do you know which SQL drivers to choose from in web platform installer?
I would recommend the newest version that matches both your platform (x86 or x64) and your version of PHP.
These are all the sql server listed:
i have php 7.3 installed
I also have installed this:
That should be everything you need.
That's what i thought. But i'm getting this error:
If you check phpinfo, is the SqlSrv module listed?
@patrickebates thanks for all the help. I'm able to load the wordpress setup config (yay!) but run into an issue with regards to the database host. I reached out to our database people and they told me to use the "sql instance name" but it didn't work. Is it expecting a computer address of where the database is hosted? Or just the name of the computer hosting the database? Kept getting database connection error and I suspect that's the issue?... or do i have to setup the wp_config.php manually? Thanks!
SqlSrv requires that the SQL instance have TCP/IP enabled as well as Mixed Mode security. If the SQL you are attempting to connect to is a named instance rather than a default, the server name might look something like this
127.0.0.1\instanceName
I think that is the correct format for SqlSrv. Haven't used PN with a named instance myself.
@patrickebates checked with our database people and they confirmed sql instance have TCP/IP and mixed mode security enabled. So far, we're able to connect to the sql database using "Windows authentication" (via microsoft SQL server management studio). But still couldn't connect using the WP setup config. Any suggestions?
Next steps... Get the name and/or IP Address of the SQL Server, including the instance name Get a username and password defined for use with Mixed Mode authentication Create an empty database to install PN into.
@patrickebates thanks so much for all your help. Was able to setup the environment (YAY!!). It's up and running. Now the only problem is how to restore my existing WP site to WP PN? I know you guys suggested to use the import/export but my export is too large hence kept getting timeout errors. Typically we use a WP plugin (updraftplus) whenever we do a full restore of our production to our dev environment but unfortunately in this case that plugin wouldn't work because of the reasons mentioned here > https://projectnami.org/plugin-compatibility/.
You can try this https://docs.microsoft.com/en-us/sql/ssma/mysql/sql-server-migration-assistant-for-mysql-mysqltosql?view=sql-server-2017
One note that is currently different for VM installs vs Azure Web Apps. PN has a setting to force UTF-8 over the SQL connection. It's off by default (due to requirements of some very old PN installs), but can be set to on with an App Setting. For Web Apps created via Deploy To Azure, we turn it on.
I wouldn't be surprised if you need it on when migrating data via SSMA above. You will need the following App Setting
ProjectNami.UTF8 = 1
@patrickebates thanks for the link. When we do the conversion, do we need to preserve the existing tables in SQL? Or we can overwrite it with the converted tables? I believe those tables were automatically created after the wordpress install.
Also, when we successfully convert MySQL to SQL, is it just a matter of copying all the plugins, uploads, themes etc in the right folder and database will automatically sync?
Thanks!
If it were me, I would perform the conversion into a new database and just modify the wp-config file to connect to it. That way you would preserve the original installation in case you need to fall back.
And yes, it should be as simple as copying your content into the same relative locations on the new server.
@patrickebates we're making huge progess! was able to convert our database. There's just couple of wordpress issues we're encountering.
- Warning: preg_replace(): Compilation failed: missing ) at offset 189 in \wp-includes\translations.php on line 1483
- Warning: count(): Parameter must be an array or an object that implements Countable in \wp-includes\post-template.php on line 293
Do you know what that could be?
Thanks so much!
- Look for a file in /wp-includes named fields_map.parsed_types.php and try changing the extension to .bak
- Not sure what that one could be. Once you solve the first one, try this one again and look for the call stack in the error logs.
@patrickebates item 1 looks to be solved by your suggestion. Thanks for that. I'm still getting the second item though. Will do some more debugging. If i have to guess it's probably a plugin issue.
On another note, do you know why i kept getting an error uploading files in wordpress backend? I suspect that it might be something to do with folder permissions. I already added IUSR and IIS_IUSRS with full access but still getting the same issue. Do you know of any other solution by any chance?
thanks so much again! -mike
@patrickebates looks like the last error i'm getting is gone right after i upgraded to the latest PN 2.2.0 version.
On another note, i'm getting the same issue as mentioned in here > https://github.com/ProjectNami/projectnami/issues/179. Was wondering if you guys figured out what's wrong with it. Didn't want to create another thread as i can see that it's still open.
Thanks so much again for all your help!