Link to home
Start Free TrialLog in
Avatar of Tony Davidson
Tony DavidsonFlag for Australia

asked on

Migrating Web site which uses SQLEXPRESS database

Hello,

I'm attempting to migrate a web site from a Windows 2008 Server to Windows Server 2012 R2.

I have migrated the Web site using EMT7 which migrates the Web site settings.

However the site appears to be using a SQLEXPRESS database, here is the connection string for the site
data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true

Open in new window


There don't appear to be any SQL Express Management tools on the source server (like Management Studio for instance) - at least not in the Start Menu, which I find surprising.

I'm a novice in this area and am wondering how to proceed

Thank you
Avatar of Tony Davidson
Tony Davidson
Flag of Australia image

ASKER

Hello

I can see that MySQL is installed and am wondering if this is the database source.

However when I open the MySQL Workbench there are no database details listed
Avatar of Dan McFadden
There doesn't need to be any database management tools on a server.  As long as your account has some sort of administrative access to the database engine, you can remotely manage the db server.

With that said, the connection string posted is for a local instance of SQL Server Express, MySQL has nothing to do with that connection string.

If you want to manage MSSQL Server, you need to install SQL Server Management Studio (SSMS), which can be downloaded from here:

https://www.microsoft.com/en-us/download/details.aspx?id=53167

You'll want to download the file named:  SQLManagementStudio_x64_ENU.exe
** I assume you have a 64bit OS, if no, download the x86 named file.

Once you install SSMS, you need to setup a connection to the server.  Tutorial link below:

https://msdn.microsoft.com/en-us/library/ms166547.aspx

Dan
Hello Dan,

I'm no longer convinced that the SQL connection string details are relevant. I'm not convinced that this particular site is using SQL.

From the source server, where the site is working, it appears that the site performs an Active Directory lookup and displays user details in a Web page.

The issue that I have is that on the destination server, after entering the URL you're prompted for user credentials, I provide credentials that work on the source server (and displays the site) but on the destination server they're not accepted so the site is not displayed.

I've checked the NTFS permissions on all the directories on the destination server and made sure that they're the same as the source server.

I've also confirmed that the Authentication settings are the same.

There is an index.php file in the Web site's folder and I assume that this is what being used to load the site. On the source server, index.php is included in the list of Default Documents for the site. On the destination server, this entry was missing, which raises a question about the validity of EMT7 migration which I have asked EMT7 support about.

However having added index.php to the Default Document list on the destination server there is no change in behaviour.
On the original server, can you run the following command and post the output file?

c:\windows\system32\inetsrv\appcmd list apppool /config /xml > MyAppPool-01.xml

Open in new window


This will export the Application Pool configuration into the XML:  MyAppPool-01.xml

Can you run the same command on the new server, but with a different file name and post?

c:\windows\system32\inetsrv\appcmd list apppool /config /xml > MyAppPool-02.xml

Open in new window


What can be done now, if you can diff the 2 XML files and see if there are any config items different.

Dan
Hello Dan,

There are quite a few differences between the two files as the source server has numerous sites and so far I have only migrated two sites (I only need to migrate 3 sites)

So I'm not sure what differences are relevant

The site that I'm interested in is: phonelist
MyAppPool-01.xml
MyAppPool-02.xml
You have the wrong .NET Framework version on the Phone LIst AppPool on the new server.

On the old server, you have it as v2.0.  On the new server, it is v4.0

On the new server, switch it back to v2.0

Dan
Now I would export the website configurations with the following commands.  To export only the specific site, use the following:

On the old server:
c:\windows\system32\inetsrv\appcmd list site “Phone List” /config /xml > Phone-List01.xml

Open in new window


On the new server:
c:\windows\system32\inetsrv\appcmd list site “Phone List” /config /xml > Phone-List02.xml

Open in new window


Also, can you post a directory listing of the following path:  C:\Windows\Microsoft.NET\Framework  from both servers?

Dan
You have the wrong .NET Framework version on the Phone LIst AppPool on the new server.

On the old server, you have it as v2.0.  On the new server, it is v4.0

On the new server, switch it back to v2.0
That would have to be an issue, but made the change and no change in behaviour
Seeing the site configurations would be helpful.  There would appear to be a difference in the website configs for the 2 servers.

Dan
Seeing the site configurations would be helpful.  There would appear to be a difference in the website configs for the 2 servers.

Can you provide more info - on how I can provide the info that you need

Thanks
There is a typo in the 2 appcmd commands... wrong quote characters.  Can you re-run these?

On old server:
c:\windows\system32\inetsrv\appcmd list site "Phone List" /config /xml > Phone-List01.xml

Open in new window


On new server:
c:\windows\system32\inetsrv\appcmd list site "Phone List" /config /xml > Phone-List02.xml

Open in new window


The name in the quotes must match the name of the website where the phone list is.  I typed "Phone List" since I do not know what the site is actually named.

Dan
The new command looks the same as the original. Please check and advise.
The quotes are different... please run the latest commands I posted.  I corrected the typo.

The difference is significant...  This character " verse this one

Dan
The error indicates there is an issue with the site name.  What is the name of the site, as shown in IIS Mananger?

Can you try the following:

old server:
c:\windows\system32\inetsrv\appcmd list sites /config /xml > Site-List01.xml

Open in new window


new server:
c:\windows\system32\inetsrv\appcmd list sites /config /xml > Site-List02.xml

Open in new window


Dan
OK, so the source of the appcmd error was the site is called phonelist, which didn't match the command line "Phone List"

1. What exactly is enabled under the "Athentication" feature for the website, on both servers?
2. What is listed under the "Authorization Rules" feature for the website, on both servers?
3. Have you installed PHP on the new server?

Dan
Authentication - both set to Windows Authentication

Authorization - both set to Allow all users

PHP is installed on the new server, but it is a later version. Also I have not done any configuration. I see that there is a php.ini file
Also it doesn't appear to be running on the destination server, I can see a php process in Task Manager on the source server but not the destination

So far have not worked out how to access the PHP Manager
I've looked at about 10 different sites via Google search and I still can't find one that explains how to access PHP manager. Ridiculous. I'll wait for your next update.
You have to install PHP Manager, its a 3rd party add-in.

You can install this via the Web Platform Installer feature or by direct download and installation.  For your first try, I recommend using the Web Platform Installer feature.

1. Open IIS Manager
2. Select the server in the left navigation
3. Go down to the "Management" section and double click the "Web Platform Installer" feature
4. In the search field in the upper right corner, type "php manager" and hit search
5. Select "PHP Manager for IIS" and click install

After the download and installation is complete, you will now see a feature under the IIS section, called PHP Manager

A. What version of PHP is installed on the old server?  Is there more than 1 version?
--- there are currently 3 versions of PHP in PROD, each version has 4 variants.
------ v5.6.30 (VC11 x86 Non Thread Safe, VC11 x86 Thread Safe, VC11 x64 Non Thread Safe, VC11 x64 Thread Safe)
------ v7.0.17 (VC14 x86 Non Thread Safe, VC14 x86 Thread Safe, VC14 x64 Non Thread Safe, VC14 x64 Thread Safe)
------ v7.1.3 (VC14 x86 Non Thread Safe, VC14 x86 Thread Safe, VC14 x64 Non Thread Safe, VC14 x64 Thread Safe)
B. What version of PHP is the phonelist site using on the old server?

I do not recommend (unless you have been instructed to do so by the DEV team) that you use a different version of PHP than what is currently installed on the old server.  Migrating a Production website to a new PROD server, is not the appropriate time to switch PHP versions.  Production is also not the place to be testing an existing web app with new/different configurations.

I also recommend paying close attention to the variant of the PHP version.  Each variant is a different installation.

You need to also install the appropriate Visual C++ Redistributable (VC11, VC14) package that is associated with the PHP version.

I use the following procedure to deploy PHP to a Windows IIS Server:

1. Install PHP Manager for IIS
2. Download the required PHP version variant and install on the server.
2a.  I place each version of PHP in its own directory off the OS drive.  For example:
------ c:\webapps\php\v5.6.30x64-NTS
------ c:\webapps\php\v7.0.17x64-NTS
------ c:\webapps\php\v7.1.3x64-NTS
3. In IIS Manager, select the server object in the left navigation panel, open the PHP Manager feature
4. Click "Register a new PHP version"
5. Navigate to the directory that contains the new PHP version you want to register, select the php.cgi.exe
6. Click OK
6a.  Do this for each PHP version you need to install on the server.  You can install & configure multiple versions.  Site can be configured to use any of the PHP versions installed and registered.
7. Click on the "Check phpinfo()" link
8. Select a website to use and select a URL to hit
8a.  This should result in the phpinfo page being displayed.

If no errors are reported, website can use the various versions of PHP installed on the server.  You can use the PHP Manage feature at the website level to change the PHP version that the site uses (in the case where multiple PHP version are installed on the server)

Dan
Hello Dan

The version of PHP on the source server is 5.3.1

The closest I can get on the destination using versions available from Web Platform Installer is 5.3.28

When I click on the Check phpinfo link.

I specify the

Site: phonelist (drop down)
URL: http://phonelist/ (drop down)

And then get the error in the screenshot

Also I don't see a php process in the tasklist, which may be due to the phpinfo error - but I mention it in case it should already be there
phpinfo.JPG
The error indicates that there is a duplicate entry type of ADD with the value of "index.php"  in the application's web.config file.

Remove the duplicate entry.

Dan
Hello Dan

There are 3 web.config files in the path to the phonelist site

I have now replaced the files on the destination server, with those on the source as I could see that there were some differences initially

When I perform the Check phpinfo now I don't get the error from before, but I still can't connect to the site.

Please refer various attachments

fyi there is no PHP Manager icon in IIS Manager on the source server so it's not possible for me to perform the Check phpinfo and compare the behaviour with the destination server
Check_phpinfo.JPG
Connect_to_site_after_Windows_authen.JPG
web.config
web.config
web.config
So first off... you can not have multiple web.configs in the root of the application directory...

1. In the root of the phonelist app (c:\inetpub\wwwroot\wss\virtualdirectories\intranet80\php\phonelist) which of the web.configs posted are there?

2.  Is this directory structure separate from any other website?  I noticed it is stored in a folder that indicates that it is a Virtual Directory... meaning that there is a root website somewhere.
3.  Can you post a screen shot of the Handler Mappings for the extension PHP?
4.  Can you post the configuration for the application pool that is supporting the phonelist site?

Dan
So first off... you can not have multiple web.configs in the root of the application directory...

Hello Dan,

And they're not.

If you hover the mouse over each of the Web.config files that I have uploaded, I have recorded the path of each web.config file
2.  Is this directory structure separate from any other website?  I noticed it is stored in a folder that indicates that it is a Virtual Directory... meaning that there is a root website somewhere.

The full path to the phonelist site is separate to any other Web site.

The full path is: C:\inetpub\wwwroot\wss\VirtualDirectories\intranet80\php\phonelist
PHP Handler Mappings.

There are two entries and perhaps there should only be one
Handler_Mappings_Summary.JPG
Handler_Mappings_Detail_1.JPG
Handler_Mappings_Detail_2.JPG
The other item I've noticed is that there is still no PHP process in Task Manager on the destination server
And there never will be a PHP process in task manager... because PHP is being hosted by IIS in the FastCGI process.

1. Do you need PHP 7 on this server?
2. If the phonelist site is only running PHP, then the .NET CLR Version setting for the AppPool should be "No Managed Code"  and not v2.0.  PHP is not managed code.
3. Can someone navigate to the phonelist via any other path?  For example, down thru your Sharepoint site?

Since the Sharepoint site is rooted in the wwwroot directory, everything under the wwwroot directory is, technically, accessible from the site using wwwroot as its root content directory.  What I'm getting at, is that it would appear to me that the phonelist site is inheriting conflicting configuration due to the directory structure and the way the sites are setup.

You have paths for the web.configs as so:

1.  C:\Inetpub\wwwroot
2.  C:\Inetpub\wwwroot\wss\VirtualDirectories\intranet80
3.  C:\Inetpub\wwwroot\wss\VirtualDirectories\intranet80\php\phonelist

The tells me that if the URL for #1 is:  http://www.mydomain.com, then I can access #2 & #3 with following URLS:

for #2:  http://www.mydomain.com/wss/VirtualDirectories/intranet80
for #3:  http://www.mydomain.com/wss/VirtualDirectories/intranet80/php/phonelist

This means that web.config settings can be inherited down the paths and cause conflicts.

If phonelist is a unique and separate website that uses only PHP, then it should be in its own unique path.  For example:

1.  C:\Inetpub\wwwroot - is for whatever the object is that uses this path
2.  C:\Inetpub\phonelist - this would isolate the content/config of the phonelist site from the rest of the site(s) on this server

As an example, on IIS servers, I would use a similar structure to deploy websites:

IIS Server Name:
webserver.mydomain.com (server IP Address is 10.1.2.3)

DNS records for websites:
1.  webserver.mydomain.com     A              10.1.2.3
2.  wss.mydomain.com                 CNAME   webserver.mydomain.com.
3.  intranet.mydomain.com          CNAME   webserver.mydomain.com.
4.  phonelist.mydomain.com       CNAME   webserver.mydomain.com.

URLs for websites:
1. wss.mydomain.com
2. intranet.mydomain.com
3. phonelist.mydomain.com

Directory structures:
-- Root directory that contains all unique sites:  C:\webapps (** nothing points to this directory... ever!) --
website 1 directory path:  C:\webapps\wss.mydomain.com
website 2 directory path:  C:\webapps\intranet.mydomain.com
website 3 directory path:  C:\webapps\phonelist.mydomain.com

AppPools for websites:
AppPool 1 name:  wss.mydomain.com
AppPool 2 name:  intranet.mydomain.com
AppPool 3 name:  phonelist.mydomain.com

Site objects for websites :
site 1 name:  wss.mydomain.com
site 2 name:  intranet.mydomain.com
site 3 name:  phonelist.mydomain.com

Site Bindings:
site 1 binding:  uses IP Address 10.1.2.3 with Host Name set to wss.mydomain.com
site 2 binding:  uses IP Address 10.1.2.3 with Host Name set to intranet.mydomain.com
site 3 binding:  uses IP Address 10.1.2.3 with Host Name set to phonelist.mydomain.com

No site shares an AppPool, no site shares a physical path to their content, All sites share a single IP but Host Names must be used.

This structure prevents sites from conflicting with each other in terms of URL space, AppPool utilization and site configuration.

Dan
Hello Dan

And there never will be a PHP process in task manager... because PHP is being hosted by IIS in the FastCGI process.

When the phonelist site is accessed on the source server there are two php-cgi.exe processes in the Task Manager.

Username: Phone list, Network Service
2. If the phonelist site is only running PHP, then the .NET CLR Version setting for the AppPool should be "No Managed Code"  and not v2.0.  PHP is not managed code.

I have no idea whether the phonelist site is only running php.

On the source server the configuration is
.NET Framework v2.0.50727
Integrated
The web.config files are taken from the source server where the phonelist site is working.

I'm sure what you describe can be made to work, but that assumes a knowledge of IIS configuration that I don't have.

From my point of view, I have a working configuration that I want to migrate.
3. Can someone navigate to the phonelist via any other path?  For example, down thru your Sharepoint site?

I'm not aware that SharePoint is installed on this server. The destination server presently has 4 sites

  1. Default
  2. phonelist
  3. TransTelHbizPortal
  4. TranstelHbizPortalTest

There is one other site that I will need to migrate so the destination server will eventually have 4 sites that have been migrated from the source server plus default

What other paths should I try to navigate to the phonelist site?
I've been trying to locate differences between the two sites

There are differences in the Modules

Modules which are listed for the site on the source but not the destination are

ServerSideIncludeModule
ServiceModel
ServiceModel-4.0
A key difference between the behaviour of the source and destination server, is that on the source server as soon as I open an instance of IE there are two php-cgi.exe processes appearing in Task Manager. These processes are started before I try to open the phonelist site.

Once I browse to the phonelist site a 3rd process appears with username 'Phone List'

On the destination server, no php-cgi.exe process ever appears.

I think we should concentrate on trying to identify the cause for this difference in behaviour between the two boxes
Have you installed the FastCGI feature in IIS, it is required to allow PHP to run?

The "PHP-CGI.exe" process is being controlled thru IIS Fast-CGI feature, it is the process that is starting the "PHP process"  For every site that is enabled to use PHP, there will be a corresponding Fast-CGI process controlling a PHP-CGI.exe.

I mentioned the alternate navigation because the Default Web Site's root directory contains the content of the phonelist (eventually) as a child directory.  Meaning the the Default Web Site can deliver the content is someone browsed to it.  It is also a potential configuration conflict because of the potential processing of multiple web.configs.  Which is where you initial post error is coming from.

Dan
Have you installed the FastCGI feature in IIS, it is required to allow PHP to run?

CGI is listed as Installed, under Application Development
I mentioned the alternate navigation because the Default Web Site's root directory contains the content of the phonelist (eventually) as a child directory.  Meaning the the Default Web Site can deliver the content is someone browsed to it.  It is also a potential configuration conflict because of the potential processing of multiple web.configs.  Which is where you initial post error is coming from.
Two questions
1. Can you advise the path I should try to access phonelist via the Default Web Site
It must be something via wss/VirtualDirectories/intranet80 etc

2. As long as I duplicate all the relevant web.config files then I should be OK ... because they work on the source server. Do you agree with my logic here?
Are some of the other steps in this document necessary?

Fast CGI setup
One more thing to check, I just noticed that you've installed the 32bit versions of PHP on the new server (based on the Handler Mappings images posted).

By default, 32bit compatibility is disabled on the AppPools, it must be manually turned on.

On the AppPool that supports the phonelist site, go into (right click) the Advanced Settings.  Under the General section, the 2nd item down is labeled "Enable 32bit Applications" and it is set to False.  Switch the setting to True.

Then test the site.

Dan
Then test the site.

No change in behaviour. Still no php process in Task Manager
The other site that I need to migrate also uses PHP. And at present it has the same behaviour as phonelist.

So the issue appears to be with the PHP configuration (i.e. it's not running)
One more thing to check, I just noticed that you've installed the 32bit versions of PHP on the new server (based on the Handler Mappings images posted).

By default, 32bit compatibility is disabled on the AppPools, it must be manually turned on.
I have tried what you recommended and it has made no difference

I have also checked the configuration of the source server. And on the source server both sites are set
Enable 32-bit Applications = False

Open in new window


In the Handler Mappings for the sites, 32 bit php-cgi.exe is being used
I've updated the path for PHP to specify (i.e. no reference to v7)
C:\Program Files (x86)\PHP\v5.3

Open in new window


After checking the web.config files, only the root and phonelist files are needed

They're quite simple and have a handful of entries

So the issue is that PHP will not run on the destination server for some reason. Whatever the reason for the Check phpinfo() not completing is the problem
I've compared php.ini on the source and destination servers and made a number of updates to the destination ini file.

No change in behaviour of Web sites on destination server

There are no errors being logged by PHP
I believe that if I navigate to the phonelist directory and issue the following command I can execute the index.php file

php -f index.php

Open in new window


When I do this I get the following output

Deprecated: Call-time pass-by-reference has been deprecated; If you would like t
o pass it by reference, modify the declaration of LDAPSort().  If you would like
 to enable call-time pass-by-reference, you can set allow_call_time_pass_referen
ce to true in your INI file in C:\inetpub\wwwroot\wss\VirtualDirectories\intrane
t80\php\phonelist\functions.inc.php on line 76

Fatal error: Call to undefined function ldap_connect() in C:\inetpub\wwwroot\wss
\VirtualDirectories\intranet80\php\phonelist\functions.inc.php on line 57

Open in new window


Given the above I don't understand why errors are not being logged by PHP

After checking the PHP.ini file,
Allow_call_time_pass_reference

Open in new window

is enabled by default

The function ldap_connect does not exist in functions.inc.php; yet the index.php executes OK on the source but fails on the destination server, so that implies that the LDAP functionality is being provided by some other module / Windows feature

OK so I need to enable the LDAP extension in PHP Manager on the destination server. I have now done this.

I don't have a PHP Manager on the source server so I don't know how to compare the list of extensions that are enabled on the source server

Also there is still no PHP process in Task Manager on the destination server unless I run PHP from the command line
ASKER CERTIFIED SOLUTION
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'll work through this and post an update later in the week

Thank you
Any additional info or feedback for this question?

Dan