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
Avatar of Kimputer
Kimputer

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.
Avatar of David Favor
David Favor
Flag of United States of America image

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.
Avatar of cdlciddit
cdlciddit

ASKER

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.


Avatar of cdlciddit
cdlciddit

ASKER

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. 
Avatar of Kimputer
Kimputer

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.
Avatar of cdlciddit
cdlciddit

ASKER

Hello @Kimputer.  I got phpmyadmin running properly.  What is my next step?
Avatar of Kimputer
Kimputer

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.
Avatar of cdlciddit
cdlciddit

ASKER

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. 
Avatar of David Favor
David Favor
Flag of United States of America image

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...
Avatar of Kimputer
Kimputer

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

https://help.dreamhost.com/hc/en-us/articles/214395768-phpMyAdmin-How-to-import-or-restore-a-database-or-table

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

Avatar of cdlciddit
cdlciddit

ASKER

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. 
Avatar of Kimputer
Kimputer

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)
Avatar of cdlciddit
cdlciddit

ASKER

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?
Avatar of Kimputer
Kimputer

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.
Avatar of cdlciddit
cdlciddit

ASKER

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. 
Avatar of cdlciddit
cdlciddit

ASKER

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. 
ASKER CERTIFIED SOLUTION
Avatar of cdlciddit
cdlciddit

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Kimputer
Kimputer

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).
Avatar of David Favor
David Favor
Flag of United States of America image

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.
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo