Backup or Copy Windows Server 2008 Configuration

No Comments

In Windows Server 2008 there is a backup tool called Windows Server Backup which however creates huge backup files. I prefer to use a simple command/batch file that copies everything I want to backup, zips it and then uploads it to Amazon S3 (aka “the cloud”)

I have not been able to find a simple way to copy all of my Windows Server 2008 settings. Theses are the bits and pieces I have found:

Copy IIS7 Configuration

To save IIS 7 (Internet Information Services) configuration, copy the config directory %SYSTEMROOT%\System32\inetsrv\config, example:

xcopy %SYSTEMROOT%\System32\inetsrv\config c:\backup\iisconfig\ /S/E

Windows Advanced Firewall Export Configuration

To export all the current configurations of your firewall to a file:

netsh advfirewall export c:\backup\advfirewall.wfw

Source: David Davis

Export Windows Registry

To export the Registry, use regedit.exe command line options. Note that export is done in background so you need to allow some time before you are able to access the exported file.

regedit /e c:\backup\regbackup.reg

Source: Speedguide

Network Settings

netsh dump > c:\backup\network-settings-netsh-dump.txt

Source: Chris Sanders


Please note that this method cannot and should not to be compared to a full backup method such as Windows Server Backup.

This method will not allow you to do a full recovery. It will mean installing Windows Server and all software from scratch and then recover the data you have backed up. Meaning an unrecoverable hard drive crash would most likely mean more downtime/recovery time.

The reason I like this method is because it takes less space which allows me to use S3 to save my backups. That means I can fully automate it (scheduled batch script and no need to change any media) and it is off-site (meaning if there is a fire where my server is, my backup is still safe). And I prefer the ease of just getting my files from a zip file if I need to check or recover anything. Besides, it’s dirt cheap, I pay Amazon S3 a few dollars for a month worth of daily 1GB backups.

WordPress on Windows/IIS cannot upgrade, add plugins, upload themes


I have been struggling with this one ever since I moved my WordPress installation from my old Windows 2003 server to a new Windows Server 2008 machine. If I try to use “automatic upgrade” to upgrade to the latest WordPress release or upgrade or add a new plugin I get to the “Connection Information” page asking me to fill out ftp host name, user name and password. When I try to upload a new WordPress theme I get 500 Internal Server Error. I have understood that this is a permissions problem in the file system but have failed to be able to solve it.
I have been trying to give various users and groups permissions on the everything from the entire wordpress directory to the wp-content folder.

However what I did not realize until today is that (at least in my Windows installation) the group IIS_IUSRS does not have any group members but I should instead give the user IUSR permissions. Too easy… 🙂
So simply do this: give user IUSR Modify and Write permissions to your WordPress directory.


PHP 5.3.1 upgrade on IIS7 and MySQL gives Internal Server Error



After a lot of googling and testing I finally found Bruce Kirkpatrick’s comment at the end of the PHP install manual

Seems it is no longer enough to have localhost in the servers local hosts file (C:\Windows\System32\drivers\etc\hosts) you also have to comment out or remove the IPv6 equivalent. localhost
#::1 localhost

After I did this everything worked ok again. Thanks Bruce!


I just upgraded PHP on my Windows Server 2008 running IIS7 from PHP 5.2.10 to 5.3.1. Used the non-threaded install package and installed for FastCGI.

After the upgrade installation worked fine for some non-database driven pages and phpinfo worked fine but whenever a page tries to accessed the MySQL database the browser only gave me a 500 Internal Server Error.

Checking the php error log (C:\Windows\Temp\php-errors.log) I get messages like this:

[24-Feb-2010 13:44:36] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\inetpub\wwwroot\XXX\ on line 32
[24-Feb-2010 13:44:36] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
in C:\inetpub\wwwroot\XXX\ on line 32
[24-Feb-2010 13:44:36] PHP Fatal error: Maximum execution time of 60 seconds exceeded in C:\inetpub\wwwroot\XXX\ on line 32