DevOps

Forums

Tips and trix, for installation and configuration, DevOps..

Comments

Permalink

Steps to export:
 

1.Open a command prompt (cmd.exe) as an administrator.
2.Navigate to the folder of "appcmd.exe", usually by running "cd C:\Windows\System32\inetsrv".
3.Export all site-info by running the command "appcmd.exe list SITE/config /xml > C:\SiteSettings.xml"
4.Export all pool-info by running the command "appcmd.exe list APPPOOL /config /xml > C:\PoolSettings.xml"
5.Export IIS-server settings by command "appcmd.exe list CONFIG /config /xml > C:\IISSettings.xml"


To do import of a XML-file, run "appcmd.exe add site /in < C:\SiteSettings.xml"

Permalink

PowerShell-script utilizing GIT to restore dates of files:
 

Get-ChildItem -Recurse | ForEach-Object {
    $commitTime = git log -1 --format='%ai' -- $_.FullName
    if ($commitTime) {
        $_.LastWriteTime = $commitTime
    }
}