Restoring Files From a Complete PC Backup
Today, I was searching for some files that I used to have on my PC, two installs ago (I’m running Window 7 RC now, before that I was running Windows 7 Beta and before that Windows Vista SP1).
However, I apparently missed something when migrating, as I could not find the files. Hopefully, I could find these on the few backups I made before installing the RC. I made backups using Complete PC Backup feature of Windows 7/Vista.
I wondered how to restore only files from an image that was not from this installation. Restore center does not find other installs backup, hence you cannot use it to restore files from another install’s backup files. As I browsed in the backup folder (that is named WindowsImageBackup), I realized that the files stored in there are some .vhd and a bunch of xml files.
I remembered that one of Windows 7 new feature is that you can mount an .vhd file in the disk manager. I never did this before, and it turned out to be piece of cake. Just read here.
Once this was done, I could access all the content of the backed up drives, and restore what I needed.
Sadly, the files were not there, they were on an install I apparently got rid of, so they are lost forever… Now that I have a Windows Home Server at home, I won’t happen again!
AHCI and Windows 7
I only discovered lately that my SATA drives were configured as IDE on my mother board’s BIOS. However, simply selecting AHCI instead of IDE in the BIOS makes it impossible to boot Windows 7 that will bluescreen.
Windows 7 supports AHCI natively, but the drivers a disabled if the drives are configured as IDE when you install. In order to make it work, you have to enable Windows 7’s AHCI drivers first, then configure the drives in the BIOS.
You can see if AHCI driver is enabled by looking in the Device Manager:
To enable Windows’ drivers, you have to change a specific key in the registry. The steps are described on Microsoft’s support website.
Once it is done, reboot, go in the BIOS and configure the SATA drives as AHCI and let Windows boot. Once you are logged in, Windows will tell you that new hardware is being installed, and once it is done, it will ask for reboot. Reboot once more, and you’re done!
You can go back to the Device Manager to witness that the driver is now enabled:
Windows 7, SQL Server 2008 and Subtext, part 2
Here is the follow up of my post on building Subtext project with Visual Studio 2008 under Windows 7, with SQL Server 2008 Express installed.
In this post, I’ll explain how to deploy Subtext from Visual Studio on the local IIS server.
So, using the “Publish…” option in Visual Studio, let’s deploy the Subtext.Web project on the local IIS.
The project will then build and be published, but the process will fail. There is a file missing in the SVN repository:
Publishing folder Skins/Colors…
Unable to add ‘Skins/Colors/skins.config’ to the Web site. Unable to add file ‘Skins/Colors/skins.config’. The system cannot find the file specified.
In the Subtext.Web project, you can see the missing file:
Solution to this is very easy:
- Delete the reference to the file in the solution (simply select the file, as in the picture above, and press delete).
- In the same panel, click on “Show All Files” button.
- Select the “skin.config” file that is now displayed, right click on it and select “Include In Project”.
What’s happening here is that there is a sync issue between the Visual Studio project file and the files on the file system. The project file references a “skins.config” file that doesn’t exist on the file system.
It is time to publish the project, again. Fails, again
Publishing folder Skins/Lightz/Scripts…
Unable to add ‘Skins/Lightz/Scripts/cityNight.js’ to the Web site. Unable to add file ‘Skins/Lightz/Scripts/cityNight.js’. The system cannot find the file specified.Unable to add ‘Skins/Lightz/Scripts/tableEffects.js’ to the Web site. Unable to add file ‘Skins/Lightz/Scripts/tableEffects.js’. The system cannot find the file specified.
Same kind of issue as before, but this time the files don’t exist on the file system.
This time, simply delete the two files from the project.
Publish again, this time it works! (Note that it worked the two previous times, but there was an error from Visual Studio as the files were not found. As the missing files were only scripts or configuration for skins, this did not prevent Visual Studio from deploying the rest of the project).
Browsing the local Subtext
Publishing was the easy part. Now, if you browse to http://localhost/Subtext, you will get an error:
Server Error in ‘/Subtext’ Application.
Object reference not set to an instance of an object.
I took me a while to spot what was wrong this time. The project file explicitly says to not copy the “Web.config” file to the output folder. So, when you publish from Visual Studio, there is no “Web.config” file copied along…
In the “Web.config” properties window, change the “Build Action” from “None” to “Content”.
There we go. Let’s publish again and browse to see if it works…
Nope, some SQL access error this time:
Cannot open database “Subtext2.1″ requested by the login. The login failed.
Login failed for user ‘IIS APPPOOL\DefaultAppPool’.
This is quite straightforward. The IIS running user doesn’t have access to the database file. But there is a catch. The “Web.config” file that is in the solution references a “.mdf” file. For some reason, I was unable to make it run with an instance database. I was also unable to find any answer about that yet. You’ll have to head to SQL Management Studio and create a database for Subtext to use.
Now, that’s not the only thing. Subtext will not work well with the new IIS 7 integrated pipeline. You’ll have to run Subtext in “classic” mode. Do this by simply changing the AppPool that runs Subtext.
One this is done, you should be able to access the install page of Subtext (just hit the root folder in IE and the wizard will take you trough.
That’s it!
PS: there is a question on StackOverflow about IIS security model, DefaultAppPool user, etc. I just posed some questions, but no one seems to be able to answer.
Windows 7, SQL Server 2008 and Subtext
As I’m now back to Java for work and miss .NET, I’m going to mess a bit with open source projects. The one I picked is Subtext, a blog engine written in ASP.NET. I’m not an ASP.NET guru, so messing around (and maybe even help, who knows?) with a project like this will likely get me some experience.
I just installed Windows 7 RC on my PC, so I’m starting from scratch here. I installed Visual Studio 2008 Standard edition, then SQL Server 2008 Express. The code that I checked out from Subtext’s SVN doesn’t build with that configuration, it needs some tweaking.
As I have been struggling to get the project to build, I writing a small post to summarize all the issues that I had and how I solved them.
SQLDMO
The first error that you will encounter when trying to build Subtext out of the SVN is this one:
Type or namespace name SQLDMO could not be found
SQLDMO is deprecated in SQL Server 2008. However, as pointed in this forum thread, there is a backward compatibility pack.
References in UnitTests.Subtext
In UnitTests.Subtext project, some of the references are broken.
As stated here, these DLLs from SQL Server 2005 have been removed from SQL Server 2008.
Delete the references to:
- Microsoft.SqlServer.ConnectionInfo
- Microsoft.SqlServer.Smo
- Microsoft.SqlServer.SmoEnum
- Microsoft.SqlServer.SqlEnum
The add the references back using “Add Reference…” dialog.
However, this is not sufficient. The project will not build and still complain:
The type ‘Microsoft.SqlServer.Management.Sdk.Sfc.IDmfFacet’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91′.
Again, using the “Add Reference…” dialog, add a reference to Microsoft.SqlServer.Management.Sdk.Sfc.
This will leave you with only two Warnings about references to CookComputing.XmlRpcV2 and Microsoft.ApplicationBlocks.Data.
However, in this state you can build the project completely. If you delete the references in the project, it will not build anymore, for a reason that I still have to identify…
And Now?
Well, technically you can build and deploy now. I’ll talk about that in coming post.
