0 Comments

We recently installed kibana (and ElasticSearch and a log parser) to better analyze the error logs of all discoverize portals. Not wanting to log into the server where kibana resides, we wanted to access it via browser.

But how do I route an external request to http://localhost:5601 and return the response?

First, I tried the steps in this installation documentation for kibana. After that I could connect to kibana via browser from an external computer. Yet somehow all other subdomains which were also hosted on that server responded with the kibana application, not with their respective sites. I removed the specific proxy type again:

do-not-use-url-rewrite-for-all-sites

Then I came about a post about routing ElasticSearch through IIS. I created a URL Rewrite inbound rule only for the kibana site:

2015-05-08_12h46_04

That was it. Of course the site is secured via SSL, but the SSL configuration was easy.

0 Comments

I had another small odyssey when I transferred our TeamCity installation to our new server.

Without an external database

If you are not using an external database the process is pretty easy:

  1. Use the UI to backup the TeamCity data
  2. Install TeamCity on the new server
  3. Copy the backup data to the new TeamCity Data Directory (usually "C:\ProgramData\JetBrains\TeamCity")
  4. Set the projects from hidden to visible in the administration area.

With an external database

If you, like we, use an external SQL database for TeamCity the migration is a totally different ball game.

  1. I backed up the data again with the UI like above.
  2. For restoring I used this documentation.

I ran into a few problems:

  • It was imperative to not startup the site before running the maintainDB command.
  • I needed to allow TCP/IP connections to the SQL instance.
  • I had some problems with my Java installation (ClassNotFoundException jdbc.SQLServerDriver - it seemed the additional 32bit installation caused the problems). These two articles helped me.
  • I also ran into some problems to get the TeamCity projects on the new server running:
    • I had to adjust the MSBuild versions.
    • For npm I had to manually create a folder because of a ENOENT error.
    • For grunt I had to add C:\Users\[username]\AppData\Roaming\npm to global PATH, and execute “npm install -g grunt-cli” there.

0 Comments

Don’t do it! Ok, do it, but only if it is really necessary. (You will probably run into a lot of problems!)

Our old server started to get old. The processor chip, RAM and HDD was outdated. We ordered a new server which is faster, has more RAM and a SSD. On our new server Monitoring is faster, TeamCity configurations run faster, web sites are being delivered faster, and the server UI is much more responsive. In the end the server change was good, but the move took quite some time!

We moved from a Windows Server 2008 R2 with IIS 7.5 to a Windows Server 2012 R2 with IIS 8.5.

Approach One: move data and configuration separately

This did not work for me this time. You copy all the data in the wwwroot directory to the new server. Then you export the IIS configuration on the old server and import it on the new server. There are a few blog posts talking about this. But you may corrupt your IIS configuration like I did. Make sure to backup the initial configuration to be able to restore it. IIS also has a history itself (C:\inetpub\history). If all fails you will have to uninstall the IIS feature and install it anew.

Approach Two: move data and configuration together

You can use Web Deploy to move all your sites and their IIS configuration to the new server (needs to be installed on both servers). I first tried it using the UI, but always ran into problem when importing. Command line syntax to the rescue! It gave me better error feedback. The command I used at the end:

C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy.exe -verb:sync -source:package=C:\_backups\IIS\IIS_PA1.zip,machineconfig32.netfxversion=2,machineconfig64.netfxversion=2,rootwebconfig32.netfxversion=2,rootwebconfig64.netfxversion=2,encryptPassword=teamaton -dest:webserver,machineconfig32.netfxversion=2,machineconfig64.netfxversion=2,rootwebconfig32.netfxversion=2,rootwebconfig64.netfxversion=2

Here you can read more about the sync verb, provider package and webserver, and encryptPassword.

Here are the problems I ran into, and how I circumvented them:

  • Dynamic IP Restrictions module is an extension in IIS 7.5, but a feature in IIS 8.5 (Web Server –> Security –> “IP and Domain Restrictions”). Therefore I needed to uninstall the extension on IIS 7.5 and only then export with Web Deploy.
  • Frameworks do not match: "The versions of the .NET Framework Configuration Provider (machineConfig64) are different on the source (2.0) and destination (4.0)." Phu, this was a tough one – I tried very many things unsuccessfully. In the end I used option 1 in this article, because option 2 never worked – even though most proposed solutions on the internet use this option 2.
  • Then I ran into the error 0x800f0922 which I fixed with this solution.
  • As usual I ran into the error “Service unavailable” after the import. This is usually an indicator that some feature is missing in the IIS. I needed to install the URL Rewrite Module.
  • A few DLLs were missing on the target machine. I had to compare the machine.configs and adjust them as needed.

Problems with WordPress web site

First I tried to transfer the WordPress blog like the other sites. Move its IIS configuration, the wwwroot folder and its MySQL database. That did not give me the desired result, and gave me quite a few headaches:

  • Web Deploy makes changes to .NET Framework config files (for instance machine.config and web.config) – I had to copy them from other server.
  • Using the PHP Manager for IIS did not help.
  • FastCGI could not be loaded because of version problems.

Probably the best way to migrate a WordPress site is using the Duplicator extension. Just two caveats: you will need to give USERS folder rights (other sites usually need rights to be given to IIS_IUSRS). And “Select Advanced Options and select the manual unzip process“ should be done in step 1 of “Run the Duplicator Installer”.

Migrate SQL databases

We migrated from SQL Server 2008 to SQL Server 2014. First thing I forgot was to ensure that the new instance is installed with “Mixed Authentication” (it allows Windows + SQL logins). I copied the databases according to this article. I only changed the level to 120, which corresponds to SQL Server 2014. Then I had to copy users with their passwords. I did it by creating a procedure.

One of our TeamCity configurations runs unit tests based on Entity Framework 6.0. It need to be able to create a database on the fly, but I always got System.Data.SqlClient.SqlException : CREATE DATABASE permission denied in database 'master'. Turns out the login NT AUTHORITY\SYSTEM needs the dbcreator Server Role.

0 Comments

Once in a while I have to configure a new server and install a few programs. To hasten that process this time I used chocolatey.

To install chocolatey just use the command shown on their homepage. After that it is just simply using cinst 7zip to install a program from command line.

It is a nice tool, but it has a few drawbacks. I couldn’t install Process Explorer or NetSpeedMonitor via chocolatey. And it installed Firefox in German (the default download page suggests the German version because of my German IP). Yes there porobably is a parameter to choose the language. All in all I would use it only for about 5 programs.

I read somewhere that it can also be used for installing roles like IIS, but I haven’t tried that yet. It also has a GUI, but I haven’t tried it out.

0 Comments

After four years with the same PC configuration (AMD Phenom 9950 Quad-Core 2.60 GHz), we decided to buy me a new central processing unit. My old PC was disctinctly slower running unit test and SpecFlow scenarios. We bought a Intel Core i7-4770K CPU, which has a three times greater CPU benchmark (about 10,000 to 3,000). Of course we also needed a new MSI motherboard and Mugen 4 CPU fan.

Installing the hardware was fun – it was my first time installing a mainboard. Here is what my PC looked afterwards:

Mainboard

Festplatten

Unfortunately my Windows Server 2008 R2 on my SSD did not like the new hardware and did not boot. I had to work out how to stop Windows to shut down when showing a blue screen. After researching the error code I changed the BIOS setting for the SSD to IDE (instead of SATA). And finally everything worked! Fixing this bug was less fun than installing the hardware.

It is nice to work with a much faster, quieter machine. The RAM upgrade from 8 to 16 helps, too. It surely boosts my productivity by a few percent – in the long run it is totally worth the upgrade.