如何将现有数据库和网站作为 MSDeploy 包的一部分进行备份?
我正在研究使用 Visual Studio 2010 进行一键部署,当前的部署过程包括压缩 IIS 文件夹的内容并在完成剩余的手动部署步骤之前备份当前数据库。这允许我们回滚部署,如果不是细节,我需要保留此过程的本质。
有没有一种方法可以使用 MSDeploy 自动执行此操作?
I am researching one-click deployment with Visual Studio 2010, the current deployment process involves zipping up the contents of the IIS folder and taking a backup of the current database before completing the remaining manual deployment steps. This allows us to roll back a deployment, I need to retain the essence of this process if not the specifics.
Is there a way of automating this with MSDeploy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以让 MSDeploy 执行备份 IIS 目录的批处理文件(请参阅示例)
您还可以编写一些SQL,将其放入.sql文件中,也执行批处理文件中的SQL脚本。请参阅此示例 至少有一个开始。它适用于 SQL Server,但如果您不使用它,那么希望您使用的数据库有类似的东西。
You can have MSDeploy execute a batch file that backs up the IIS directory (see example)
You can also write some SQL, put it in a .sql file, execute the SQL script in the batch file as well. See this example to at least get a start. It is for SQL server, but if you are not using that then hopefully the database you are using has something similar.
终于我找到了答案,感谢 kniemczak 发布有关如何从命令行备份 IIS 和 SQL Server 的信息。
看来以下:
应该满足我的需求。
Finally I found the answer, thank you to kniemczak for posting the information about how to backup IIS and SQL Server from the command line.
It seems the following:
Should cover my needs.