-
Notifications
You must be signed in to change notification settings - Fork 0
The Backup Module
You'd use the Backup Module when you want to perform a content backup of your IIS site (probably before you deploy a new version or something). Internally it uses the Backup-WDApp cmdlet and that in itself is just a fancy wrapper around the iisApp Provider.
This introduction will show you how to:
- add the NuGet package
- trigger the execution
- discuss the default conventions
Let's begin!
You can either:
- use NuGet
Install-Package WDP.Backup
. (preferred way)
- note: this installs a solution-level NuGet package and the PS file will be placed in the
packages
folder.
- or manually download the PS file to a desired location.
- import the PS module:
Import-Module [PATH_TO_PSMODULE_ROOT_FOLDER]\wdp.backup.psm1
- note:this assumes that the name of the PS file is
wdp.backup.psm1
- invoke the backup function:
Invoke-Backup test.xample.com
- note: this example backups the web application
test.xample.com
on the local (localhost) IIS.
- The IIS site/application is required and will be determined by either:
1) the parameter you send to Invoke-Backup (like in the example above). Backups a site/application on localhost and thus executing the script from the same server.
2) or via supplying one or more [[.publishsettingsfiles|Using PublishSettings files]] that determine the location of the servers (and how to connect to them) etc. (see examples for more information)
3) or a combination (see examples).
WDP.Backup
is built with conventions, before/over configuration, in mind which means that it assumes a lot of things in order for you to not get lost in configuration hell right away.
However it is important that you have knowledge about the conventions, the defaults, that we're assuming. If you don't like them just change them by overriding one or more of the properties that you see below.
default: optional [not set by default]
If you wish to backup a site/application located on a remote server/s use this property that will accept an array of the paths to .publishsettings files that represent these servers.
default: \.Backups
We will place all the backups in [CURRENT_DIRECTORY]\Backups
.
default: [depends on TeamCity]
The default is if the code executes within TeamCity this parameter will default to true. Otherwise it's false.
It controls whether or not the backup file will be published as a build artifact by TeamCity.
default: optional [not set by default]
Custom Provider Settings that you can enable. Read more on the iisApp Provider.
default: optional [not set by default]
Folders you want to skip during backup.
default: optional [not set by default]
Files you want to skip during backup.
default: true
Debug messages is a better word for this perhaps. By default we will log some extra information. If you execute within TeamCity these messages will be formatted to work with TeamCity.
If you turn this off, there will be no extra information logged.