Lập Lịch Backup và Restore Sharepoint – Lab Sharepoint 2016 Phần 5

Backup và restore sharepoint là việc làm rất quan trọng và cần thiết của người quản trị sharepoint. 

Khi hệ thống Sharepoint đang hoạt động bình thường, thì có sự cố là không thể truy cập vào các site được nữa, có thể do nhiều nguyên nhân khác nhau. Để có thể đưa hệ thống làm việc trở lại, một cách nhanh nhất, thì người quản trị sharepoint phải có kế hoạch backup sharepoint server định kỳ, để có thể restore lại hệ thống khi cần.

Triển Khai Lập Lịch Backup và Restore Sharepoint:

Trong bài LAB này gồm các phần sau:

  • Tạo Folder và Share full quyền
  • Backup sharepoint site
  • Giả lập mất site
  • Restore site
  • Lập lịch backup sharepoint định kỳ
  • Restore sharepoint từ backup file.

Sau khi thực hiện xong bài lab, các bạn sẽ biết cách backup và restore hệ thống sharepoint 2016. Có thể lập lịch tự động baclup định kỳ, và restore lại hệ thống từ backup file.

Thực hiện Lập Lịch Backup và Restore Sharepoint như thế nào: 

B1: Tạo Folder backup và Share full quyền

B1: Tạo Folder backup và Share full quyền

Vào đĩa folder backupSp Properties tab “Sharing” cho everyone full control Ok

qua tab security cấp everyone full control.

Backup và restore sharepoint

B2. Backup Sharepoint site:

B2. Backup Sharepoint site:

Vào Sharepoint 2016 Central Administration, Chọn Backup and Restore Perform a backup.

Backup và restore sharepoint

Check vào site cần backup Next

Backup and restore sharepoint

Backup Type: Chọn option Full, Backup location: \\ser100\backupSP Start Backup

Backup and restore sharepoint

Ấn Refresh để xem quá trình backup. Và chờ quá trình backup hoàn tất.

Backup and restore sharepoint

B3. Giả lập mất site:

B3. Giả lập mất site:

Chọn Application Management Manage Web application

Backup and restore sharepoint

Chọn site cần xóa, chọn Delete Delete Web Application

Backup and restore sharepoint

Delete content database chọn yes, Delete IIs web site chọn Yes Delete

Backup and restore sharepoint

B4. Restore site:

B4. Restore site:

Tại Central administration backup and Restore Restore from a backup.

picture014

Chọn site và thời gian cần restore Next

Backup and restore sharepoint

Chọn site cần restore next

picture016

Type of Restore chọn same configuration, nhập user name và password Start Restore

picture017

Chờ quá trình Restore hoàn tất, và truy cập site để kiểm tra lại.

B5. Lập lịch backup sharepoint.

B5. Lập lịch backup sharepoint.

Bạn cũng có thể vào Sharepoint 2016 management shell và thực thi lệnh sau:

Backup-SPFarm -Directory c:\backupSP -Item “Sharepoint – int.ctl.local80” -BackupMethod Full

Và dùng lệnh Get-SPBackupHistory để xem các backup đã thực hiện.

picture021

Để lập lịch backup các bạn tạo file backup_full_int.ps1 với 2 lệnh sau:

Add-PsSnapin Microsoft.SharePoint.PowerShell

Backup-SPFarm -Directory c:\backupSP -Item “Sharepoint – int.ctl.local80” -BackupMethod Full

picture022

Và file backup_Differential_int.ps1 có 2 lệnh sau:

Add-PsSnapin Microsoft.SharePoint.PowerShell

Backup-SPFarm -Directory c:\backupSP -Item “Sharepoint – int.ctl.local80” -BackupMethod Differential

picture023

Sau đó vào Run gõ lệnh tackschd.msc

picture024

Phải chuột vào Task Scheduler, chọn Create Basic task

picture025

Name: Backup Full Weekend next

picture026

Chọn Weekly next

picture027

Chọn ngày giờ backup full next

picture030

Chọn option Start a Program next

picture031

Trong program/script: nhập PowerShell – file “c:\backup_full_int.ps1” next yes

picture032

ấn Finish. Hoàn tất tạo lịch full backup.

Backup và restore sharepoint

Tương tự tạo lịch backup Differential. Phải chuột vào Task Scheduler chọn Create task

Backup và restore sharepoint

Name: Backup Differential int next

Backup và restore sharepoint

Chọn Weekly next

Backup và restore sharepoint

Chọn thời gian và các ngày backup differential next

picture039

Trong phần Program/script: PowerShell –file “c:\backup_Differential_int.ps1” next yes

picture040

Ấn Finish hoàn tất tạo lịch backup differential

picture044

B6. Restore sharepoint từ backup file

B6. Restore sharepoint từ backup file

Giả lập mất site: vào Application management manage Web application, chọn site cần xóa, chọn delete Delete web application.

picture047

Delete content database chọn Yes, Delete IIs web site chọn yes

picture048

Để restore site từ backup file bạn có thể vào central administration chọn backup and restore và chọn restore from a backup.

picture045

Chọn file và thời điểm cần restore

picture046

Hay có thể vào folder chứa file backup tìm và Edit file Spbackup.xml

picture049

Copy SPId

picture050

Rồi vào sharepoint 2016 management shell thực thi lệnh:

Restore-SPFarm -Directory c:\BackupSP -BackupId cc00415c-c687-4f2e-b7af-d0cea45c8764 -RestoreMethod new

picture051

Nhập vào password của user quản trị sharepoint , và chờ quá trình restore

picture053

sau khi Restore đã thành công. Truy cập vào site Int.ctl.local để kiểm tra lại.

Hoàn tất bài lab Backup và Restore Sharepoint 2016.

Mr CTL – labs.ctl.vn

Lab Sharepoint 2016 Phần 6

Leave a Reply