How to upgrade your existing hard disk in Windows Vista without losing data (Part 1)

Well, there you are. You have just realized that your existing local system hard disk is rapidly becoming more and more full. So now you have purchased a brand new 500GB hard disk to be replacing the existing 120GB system disk that you currently have installed as C:\. But going through the steps of formatting a fresh new disk and installing all those programs that you need is somewhat intimidating because you now it will set you back at least a couple of hours of expensive time that you could use to developing new cool things. So what do you do? Well, one option would be to purchase one of those image ghosting tools, like Norton Ghost, or other similar products. But if you are running Windows Vista, there are an alternative.  Which, in my eyes, are far more attractive. You see, Vista has a built in backup utility that can make a complete PC backup of your system with just a few clicks. By backing up your entire system disk to a .vhd file (image file) you can later import this file in the install process. Here are the steps:

1. Backup your entire C:\ to an external USB disk. (Or internal hard disk.)

2. Shutdown your PC, and replace your current C:\ with that brand new disk.

3. Put in your Windows Vista DVD and boot from it and start a new setup.

4. Select the .vhd file you created in step 1.

 

Let me walk through the steps, in this first part I will describe steps 1 and 2. Steps 3 and 4 will be described in the second part.

The backup utility can be found in All Programs->Accessories->System Tools->Backup status and Configuration. Select the Complete PC Backup option in the left pane.

This is a screen shot of the Windows Complete Backup startup window.
1.Click on Create a backup now.
This is a screen shot of the Complete Backup window, selecting destination.
2. Select the desired location of the backup file end click Next.
This is a screen shot of which disks you want to include in the backup.
3. Select the C:\ System disk and click Next.
This is a screen shot of the final confirmation window before starting the backup.
4. Click on Start backup to start the backup.
This is a screen shot of the backup in progress.
5. Back in progress.
This is a screen shot of the completed backup.
6. Click Close when the backup has finished.

 

This completes the full PC backup process. Continue to part 2 to perform the restore process.

Getting PayPal IPN posting to work with Webhost4Life

After setting up an aspx page that accepts IPN postings from PayPal on my domain, I got this error when trying to post IPN data:

 

The remote server returned an error: (999) No Hacking

 

Well, I didn’t have this problem with my previous hosting company, nor when trying on my local IIS web site. So I contacted Webhost4Life, on their live chat support. That didn’t help much. But I finally found the solution.

It turns out that Webhost4Life has a functionality called Security Guard. Turning this off for my sub domain did the trick.

You will find the Security Guard in your Control Panel, Security section.

This is a screen shot of the Webhost4Life Control Panel, where you can turn off the Security Guard.

Technorati Tags: ,,,,

How to properly do a bulk copy of tables that contains identity columns

I have been struggling with this for a couple of hours now. Now matter what options I set in the Microsoft SQL Server 2005 Import and Export Wizard, I cannot manage it to correctly transfer my identity columns.

It turns out that this is a bug in SQL Server 2005. There are a couple of proclaimed workarounds like this and this. However that didn’t work for me. I cannot uncheck the “Optimize for Many Tables”, because if I do, I get a lot of other key errors when the package runs.

So I stumbled upon this utility, the Simple SQL Bulk Copy.

This is and image that shows a screen shot of the Simple SQL Bulk Copy utiliy.

It worked great! My tables containing identity columns was transferred correctly.

How to bulk export multiple tables from SQL Server

Maybe you have been in the same situation as I ? You need to bulk export multiple tables from SQL Server, and can’t find any option in the Import and Export Wizard within SQL Server 2005. At least I couldn’t find any out of the box functionality to do this. So I went ahead and wrote a small T-SQL script that uses the BCP command utility to perform this desired task.

 

SQL Script – Copy Code
SET NOCOUNT ON DECLARE @cmd NVARCHAR(2048) DECLARE @tableName NVARCHAR(2048) DECLARE @outPath NVARCHAR(2048) SET @outPath = c:\temp\ DECLARE tableCursor CURSOR FOR SELECT [name] FROM sysobjects WHERE type=U FOR READ ONLY OPEN tableCursor FETCH NEXT FROM tableCursor INTO @tableName; WHILE @@FETCH_STATUS = 0 BEGIN SET @cmd = bcp [ + db_name() + ].. + @tableName + out +
      @outPath + @tableName + .txt -t”,” -T -c -S + @@servername PRINT @cmd EXEC master..xp_cmdshell @cmd, NO_OUTPUT FETCH NEXT FROM tableCursor INTO @tableName; END; CLOSE tableCursor; DEALLOCATE tableCursor;

If you try to run this on a SQL Server 2005, you may encounter this error:

Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure ‘sys.xp_cmdshell’ of component ‘xp_cmdshell’ because this component
is turned off as part of the security configuration for this server.
A system administrator can enable the use of ‘xp_cmdshell’ by using sp_configure.
For more information about enabling ‘xp_cmdshell’, see “Surface Area Configuration” in SQL Server Books Online.

In that case you have to unlock the possibility to execute xp_cmdshell usi
ng this script:

SQL Script – Copy Code
sp_configure show advanced options, 1 GO RECONFIGURE GO sp_configure xp_cmdshell, 1 GO RECONFIGURE GO