Avatar of cdlciddit
cdlciddit asked on

How can I install Drupal 7 on a Windows Server 2012 R2

I need to move a Drupal 7 site over to a different server.  The new server is Windows Server 2012 R2.  Since Web Matrix is no longer recommended and it has been discontinued, is there a way to install it using Visual Studio instead?  Are there any good videos or instructions on how to do this?
InstallationWindows OSWindows Server 2012Drupal

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon

Drupal needs PHP support as well as MySQL (or MariaSQL). Both are supported on Windows, either through IIS or through Apache or other solutions (WAMP). Using WAMP, the site could even be running within 2 minutes (obviously you need slightly more time to transfer everything correctly).
Names you used, are not related to Windows 2012 server and making Drupal work at all.
Since every migration is different, there's not a simple video suited for you.
Steps are:

1. Get the webserver working properly
2. Get the PHP engine working properly
3. Get the database support working properly.
4. Get the old files to the correct location and import database backup.
5. Make sure hostnames (FQDN) is pointed correctly to your server.
David Favor

Drupal is just PHP.

So steps are...

1) Get your Webserver + PHP + MariaDB/MySQL working on your new Windows server.

2) Only proceed after you've tested #1 + verified all is well.

3) Then just make a normal Drupal backup (however you do this) on old server.

4) Then do a restore on your new server (requires creating + loading the old server's Drupal database).

5) Change the IP from old server -> new server.

Nothing overly complex about this... except... getting WAMP working correctly.

Thanks guys.  I'm setting up a test server with Windows Server 2012 R2 right now.  I'm doing all the critical updates then I'm going to follow your instructions and report back tomorrow. Thanks a lot.

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

Hello @Kimputer and @David Favor .  Thank you again for your feedback.  I didn't want to bother you over the weekend.  But I did get my server set up.  I set up a Server with Windows Server 2012 R2.  I installed PHP v. 7.4.13 and My SQL for windows 5.5.  However I did  not install MariaDB or WAMP.  I did not install WAMP because I got IIS working properly as the web server.  I have to use IIS because the other sites on the server are WordPress and .Net sites and they are working fine with IIS now.  I didn't install MariaDB because I read that it should work with SQL Server.  If it does work with SQL Server I would rather use that because I am a little more familiar with it. If it doesn't then I don't have any problem using MariaDB or whatever I need to use.    I didn't go any further because I'm a little confused at this point on what to do next.  I am a complete newbie to Drupal.  I know absolutely nothing about it.  I have the entire old Drupal site in .zip format.  The database is included in the zip file with the other files. Right now I have a ip assigned to it for testing.  I want to make sure it's working before I move the IP from the live working site. 

MariaDB is the alternative if you don't like MySQL. They both basically function the same.
To know if your installation is fully ready, try to get PHPMyAdmin running properly.
Go to https://www.phpmyadmin.net/, Unzip the download to a folder, open that new location in the browser. If you can properly log in as root, you're one step closer.
If not, PHP might not be working, or you didn't enable MySQL support in PHP yet.

Hello @Kimputer.  I got phpmyadmin running properly.  What is my next step?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

Import the Drupal database. Restore Drupal files to site root (or subfolder if it was originally in a subfolder).
You'll get a MySQL error. Check the Drupal config file, look for the database user/password.
Add user to MySQL with the correct password. Assign full Drupal database rights to this user.

Thanks @Kimputer.  I think I've done that.  I'm just a little confused.  How do I know Drupal is installed?  So far I haven't done anything to suggest that it's installed.  Here is what I've done so far.

1. Installed Windows server 2012 r2
2. Got IIS web server going
3. I installed PHP v. 7.4.13
4. I installed My SQL for windows 5.5
5. I installed PHPmyAdmin and logged in to make sure PHP was installed correctly
6. I copied all the files for the Drupal site to the wwwroot directory of my webserver.

So, now I have all the files for the Drupal site restored to the wwwroot directory of my webserver.  The database file is just a .sql file in the same directory.  I did not know where to restore it to.  I also don't think Drupal is installed or what I need to do to install it. 
David Favor

About IIS + Drupal.

It's very likely this will created a fairly substantial extra amount of work for you, which is great if you have unlimited time on your hands.

A great deal of Drupal code depends on the Apache rewrite system (specific syntax of .htaccess files).

If you use IIS, then each time you install code, you'll have a new project of trying to determine if/how your newly installed code interacts with Apache via .htaccess syntax.

Then somehow convert the .htaccess syntax over to IIS.

So... you'll learn a great deal... invest massive amounts of time... likely have a highly unstable site, till you truly figure out your .htaccess -> IIS conversion process... for each shred of code your install into Drupal...

Whew... I'm getting tired just thinking about all this work...
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

Use PHPMyAdmin to read the SQL file back. Steps are described here:


Then still follow up with the steps I already told you:

Check the Drupal config file, look for the database user/password.
Add user to MySQL with the correct password. Assign full Drupal database rights to this user.

In case @David posts applies to you (you need beauty urls), then apply this as well: http://www.helicontech.com/isapi_rewrite/doc/litever.htm


Hey @David Favor. Thanks for the information.  Wow. I didn't knw all that.  I'm just looking for an easy way to move a Drupal site from one server to another.  Is there an easier way to run Drupal on a Windows Server?  Is there a way to do it without using IIS?  Can you only run one web server on a machine?  Is there a way to convert a Drupal site to a WordPress site? I already have WordPress running. 

I already gave you the solution to @David posts?
You can always run another web server, they just will never be able to serve it the same way (one site will have to give way, and NOT be htttps://site1.com, but https://site2.com:8080)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

Hello and thanks guys for trying to help me. @Kimputer,   I was able to restore the database and all the files to the root directory of my server.  I also think I understand what you said about 2 web servers on the same machine.  I can do it as long as they listen on different ports.  They both can't listen on 8080?  But I still don't understand where the installation of Drupal comes in.  Is it software?   I assumed it would be like WordPress.  Find an install package for Windows and install it.  I'm guess Drupal doesn't work like that?  Can I convert a Drupal site to something else? Would that be easier?

@David Favor. I'm sorry but I definitely don't know how to convert .htaccess code to IIS.  Is there any other way?

Again, the  .htaccess solution was posted by me already.

You restored the .sql file to the site. But that's just a file. You need to use PHPMyAdmin to read it back INTO the database. The steps were ALSO posted by me in an URL.

Converting is not easier. Getting the site back from backups is easier.

Thanks you @Kimputer. I was able to use PHPMyAdmin to read the database file.  I'm going back through your post to figure out the next step. 
Your help has saved me hundreds of hours of internet surfing.

Hello @Kimputer. I want to thank you for all your help and all the time you spent answer my newbie questions.  I know it was frustrating.  But I finally got it to work.  I was only able to use Microsoft Web Platform Installer to install MySQL 5.5 and PHP 7.4.  Then I downloaded Drupal 7.81 from the Drupal website.  I unzipped it in the wwwroot directory and then went to my browser and typed localhost/drupal and started the install. 

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Glad I helped you. Though you're echoing my exact solution. It's more fair to expert to distribute points to the correct helper(s).
David Favor

For completeness...

1) Is there an easier way to run Drupal on a Windows Server?

Nothing about Drupal + IIS will be easy.

Running this combo will likely require far more time + effort than Drupal + Linux.

2) Is there a way to do it without using IIS?

Simple solution to this question seems to be Linux, so likely I don't understand what you're asking.

3) Can you only run one web server on a machine?

By Webserver I take this to mean IIS or Apache or NGINX.

The answer is no.

You can run as many as you like.

If you run HAProxy listening for incoming port 80/443 requests, you can proxy/route/forward each different host/domain to another backend Webserver.

4) Is there a way to convert a Drupal site to a WordPress site?

Anything's possible, given sufficient time/budget/will/expertise.

I'd start by searching GitHub for code to do this.

https://github.com/search?q=convert+drupal+to+wordpress provides several tools to test.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.