LoginSignup
1
0

More than 5 years have passed since last update.

MSDeployでフォルダのバックアップ/リストア

Last updated at Posted at 2016-12-02

やること

IIS上のWebアプリケーションに新バージョンをデプロイする前にファイルのバックアップを取得する。
リリース作業で何かが起きて切り戻す事になった時に、元の状態に戻す。
rsyncっぽいことをする(?)

アクセス権限は無視してバックアップ

backup.ps1
msdeploy.exe -verb:sync -source:contentPath=`"Default Web Site/fuga`" -dest:contentPath:C:\fugaBackup

リストアする場合はsourceとdestを入れ替える。

restore.ps1
msdeploy.exe -verb:sync -source:contentPath=C:\fugaBackup -dest:contentPath:`"Default Web Site/fuga`"

アクセス権限ごとバックアップ

includeAcls=Trueを設定するとアクセス権限を含めてバックアップできる。

backup.ps1
msdeploy.exe -verb:sync -source:contentPath=`"Default Web Site/fuga`",includeAcls=True -dest:contentPath:C:\fugaBackup

リストアする場合はsourceとdestを入れ替える。

restore.ps1
msdeploy.exe -verb:sync -source:contentPath=C:\fugaBackup,includeAcls=True -dest:contentPath:`"Default Web Site/fuga`"
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0