Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> ฐานข้อมูล

การย้ายหลาย IIS Sites ไป Cloud อย่างง่ายดาย

อาจถูกขอให้ migrate multiple Internet Information Server (IIS) sites จาก on-premises ไป Cloud การ migrate แยกแต่ละ site ใช้เวลานานและยุ่งยาก บล็อกนี้พูดถึงการลดความซับซ้อน

บทนำ

Microsoft Web Deploy tool ใช้ export sites และ content จาก source import ไป target environment ขั้นตอนใช้ Web Deploy migrate IIS sites:

  1. Install Web Deploy บน source และ target servers
  2. Export IIS contents จาก source environment ด้วย Web Deploy
  3. Copy data จาก source ไป target ด้วย PowerShell copy/sync command
  4. Import IIS contents เข้า target environment 用 Web Deploy
  5. Copy database จาก source ไป target 用 backup/restore commands (ตัวอย่างใช้ MySQL database)

Install Web Deploy on Source and Target Servers

  1. Install Web Deploy ดาวน์โหลด Microsoft Web Platform Installer (WebPI) รวม Web Deploy
  2. Launch installer หลัง WebPI download
  3. Type Recommended ใน search bar เลือก Recommended Configuration for Hosting Providers
  4. Click Items to be installed ดู components รายการที่มี "X" ถัดไป remove ได้ Screenshot แสดง Web Deploy features
  5. Don't uncheck anything Click Next, Install Installation เริ่มหลัง accept license agreement
  6. หลัง WebPI installation completes Close WebPI

Export IIS Contents from Source Environment

Backup files ต่อไปนี้ก่อน export:

  • C:\Windows\System32\inetsrv\config\administration.config
  • C:\Windows\System32\inetsrv\config\applicationHost.config

ไฟล์เหล่านี้มี site settings ทั้งหมด ขั้นตอนต่อไป modify files เฉพาะ destination server หากมีปัญหา restore file backups

หลัง backup copies ดำเนินการบน source server:

  1. Open IIS 7.0 Manager บน source server
  2. Right click server name, select Deploy, click Export Server Package
  3. Click Manage Components 确保 first Provider Name คือ webServer (export entire server config) หากขาด click cell ใต้ Provider Name เลือกจาก list
  4. Click OK, Next, Next อีกครั้ง
  5. Enter path บันทึก exported file Click Next
  6. หาก prompt ใส่ encrypted password สำหรับ secure settings
  7. Click Finish ใน Export Progress and Summary screen

Copy Data from Source to Target Environment

Copy export file ไป target server 用 standard robocopy commands, Windows copy utility, หรือ copy utility ที่ต้องการ

Import IIS Contents into Target Server

  1. Open IIS 7.0 Manager บน destination server
  2. Right click server name, click Deploy, click Import Server or Site Package
  3. Browse ไป exported zip file จาก source server select it
  4. Click Next
  5. หาก prompt ใส่ encrypted password
  6. Click Next
  7. Click OK overwrite existing IIS configuration on server
  8. Click Next
  9. Click Finish ใน Export Progress and Summary screen

Resolve Import Failure

หาก package import fail ด้วย error: Child object 'customFields' cannot be added to object 'logFile'. The 'logFile' provider may not support this deployment.

  1. Open zip file exported 用 msdeploy
  2. From zip file archive.xml 在 text editor
  3. Remove lines with customFields
  4. Save xml file
  5. Import zip อีกครั้ง

Backup and Restore MySQL Database

Backup MySQL database บน source server 用 mysqldump command Restore MySQL database บน target server 用 mysql command กับ dump file name ที่สร้าง

สรุป

Migrate IIS sites manually เป็น monolithic work Web Deploy ทำให้ migrate thousands of sites และ configuration seamlessly ไป target environments ไม่ต้องกังวล code Web deploy ไม่เพียง automate migration มากส่วนใหญ่ ยัง eliminate human error และ save time