wannabecraig
asked on
Sharepoint Automated Backup Restore Process Verification
Hi All,
I automated the following powershell backup in a scheduled task we are running Sharepoint foundation 2010.
https://gallery.technet.microsoft.com/scriptcenter/9b99c435-8831-4c9e-a70b-1f13158ef22a - Here is the script.
https://mycentraladmin.wordpress.com/2011/07/14/how-to-set-up-a-scheduled-task-to-backup-your-sharepoint-farm/ - This is how i setup the scheduled task to run this.
In the backupdir location I am getting a folder with 10 or 20 bak files.
This is the last lines of the SPBACKUP.LOG
[25/03/2015 16:10:01] Finished with 0 warnings.
[25/03/2015 16:10:01] Finished with 0 errors.
[25/03/2015 16:10:01] Backup completed successfully.
[25/03/2015 16:10:01] -------------------------- ---------- ---------- ---
Questions I have.
1. How do i restore all of these bak files?
2. How do i verify this is a good backup?
EDIT - I have looked in the backup directory I have one folder and one xml file, within the folder there are 29 files 27 are bak files. The total size of this folder is 225KB which makes me think something is wrong here.
I automated the following powershell backup in a scheduled task we are running Sharepoint foundation 2010.
https://gallery.technet.microsoft.com/scriptcenter/9b99c435-8831-4c9e-a70b-1f13158ef22a - Here is the script.
https://mycentraladmin.wordpress.com/2011/07/14/how-to-set-up-a-scheduled-task-to-backup-your-sharepoint-farm/ - This is how i setup the scheduled task to run this.
In the backupdir location I am getting a folder with 10 or 20 bak files.
This is the last lines of the SPBACKUP.LOG
[25/03/2015 16:10:01] Finished with 0 warnings.
[25/03/2015 16:10:01] Finished with 0 errors.
[25/03/2015 16:10:01] Backup completed successfully.
[25/03/2015 16:10:01] --------------------------
Questions I have.
1. How do i restore all of these bak files?
2. How do i verify this is a good backup?
EDIT - I have looked in the backup directory I have one folder and one xml file, within the folder there are 29 files 27 are bak files. The total size of this folder is 225KB which makes me think something is wrong here.
You do not need to individually restore each file. Use the restore cmdlet and just reference the first file name, and the others are included automatically.
ASKER
Hi Sneekco,
Are you farmiliar with this script?
Does it sound like it is working correctly?
Is there any way I can verify the backup is working correctly?
If I do a backup manually from Sharepoint Central Admin the outputted file is 20MB in size so I do not see how this backup is actually working properly.
Thanks for the quick response.
Are you farmiliar with this script?
Does it sound like it is working correctly?
Is there any way I can verify the backup is working correctly?
If I do a backup manually from Sharepoint Central Admin the outputted file is 20MB in size so I do not see how this backup is actually working properly.
Thanks for the quick response.
Yes, something does not sound correct. Check the size again. You will get a successful message, but the backup continues to run and the size of the folder will increase. Depending upon the size of the farm, the folder will grow until the process is actually finished.
ASKER
Does the account running this task require access within SQL over the instance?
In the Requirements it doesnt seem to say it requires anything but add-spshelladmin which I have granted.
I get these errors in the logs.
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e 3cc9a71-bb 73-4815-80 96-29f9f49 0fb42] SQL Server Connection String: Data Source=SERVERNAME(edit)\Sh arepoint;I nitial Catalog=SharePoint_AdminCo ntent_e3cc 9a71-bb73- 4815-8096- 29f9f490fb 42;Integra ted Security=True;Enlist=False ;Connect Timeout=15.
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e 3cc9a71-bb 73-4815-80 96-29f9f49 0fb42] SQL command started at: 25/03/2015 16:41:47. This command may take a while to complete and without notification.
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e 3cc9a71-bb 73-4815-80 96-29f9f49 0fb42] SQL Server Command: BACKUP DATABASE [SharePoint_AdminContent_e 3cc9a71-bb 73-4815-80 96-29f9f49 0fb42] TO DISK=@db_loc WITH NAME=@db_name, STATS=5, NOINIT, NOSKIP, NOFORMAT, NOREWIND
@db_name=SharePoint_AdminC ontent_e3c c9a71-bb73 -4815-8096 -29f9f490f b42, @db_loc=\\backupdir$(edit) \spbr0000\ 00000043.b ak
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e 3cc9a71-bb 73-4815-80 96-29f9f49 0fb42] SQL command timeout is set to 1.00 hours.
[25/03/2015 16:41:47] Warning: [SharePoint_AdminContent_e 3cc9a71-bb 73-4815-80 96-29f9f49 0fb42] Cannot open backup device '\\backupdir$(edit)\spbr00 00\0000004 3.bak'. Operating system error 5(failed to retrieve text for this error. Reason: 15105).
BACKUP DATABASE is terminating abnormally.
In the Requirements it doesnt seem to say it requires anything but add-spshelladmin which I have granted.
I get these errors in the logs.
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e
@db_name=SharePoint_AdminC
[25/03/2015 16:41:47] Verbose: [SharePoint_AdminContent_e
[25/03/2015 16:41:47] Warning: [SharePoint_AdminContent_e
BACKUP DATABASE is terminating abnormally.
ASKER
Here are the requirements for this script. We are on Sharepoint Foundation 2010
Included below is an entry in the windows app log event viewer.
REQUIRED: the account serving as the identity of the Scheduled Task must have the
following permissons on that server:
- WSS or MOSS:
- DB_CREATOR and SECURITYADMIN roles in the SQL instance hosting
the farm's SharePoint databases
- local administrator rights on the server
- DB_OWNER rights on the farm's SharePoint databases
- Read, Write, and Update rights in the shared directory where backups
are created
- SharePoint Foundation 2010 or SharePoint Server 2010
- It must be granted the SHAREPOINT_SHELL_ACCESS role via the
Add-SPShellAdmin CMDLET - DONE
- Full Control of the shared directory where backups are created - DONE
- The account that runs the SharePoint 2010 Timer Job (SPTimerV4.exe) service,
and the SQL Server instance's SQL Service account must have Full Control
of the shared backup storage directory - THis was not done Network Service was not added but now is.
Update - Checked the windows app log filled with errors like this Log Name: Application
Source: MSSQL$SHAREPOINT
Date: 25/03/2015 16:52:50
Event ID: 3041
Task Category: Backup
Level: Error
Keywords: Classic
User:
Computer:
Description:
BACKUP failed to complete the command BACKUP DATABASE SharePoint_AdminContent_e3 cc9a71-bb7 3-4815-809 6-29f9f490 fb42. Check the backup application log for detailed messages.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="MSSQL$SHAREPOINT" />
<EventID Qualifiers="49152">3041</E ventID>
<Level>2</Level>
<Task>6</Task>
<Keywords>0x80000000000000 </Keywords >
<TimeCreated SystemTime="2015-03-25T16: 52:50.0000 00000Z" />
<EventRecordID>46670</Even tRecordID>
<Channel>Application</Chan nel>
<Computer></Computer>
<Security UserID="S-1-5-21-172853666 2-14633082 4-32686096 31-2660" />
</System>
<EventData>
<Data>BACKUP DATABASE SharePoint_AdminContent_e3 cc9a71-bb7 3-4815-809 6-29f9f490 fb42</Data >
<Binary>E10B00001000000014 0000004900 4E00540052 0041004E00 450054005C 0053004800 4100520045 0050004F00 49004E0054 0000000000 0000</Bina ry>
</EventData>
</Event>
Included below is an entry in the windows app log event viewer.
REQUIRED: the account serving as the identity of the Scheduled Task must have the
following permissons on that server:
- WSS or MOSS:
- DB_CREATOR and SECURITYADMIN roles in the SQL instance hosting
the farm's SharePoint databases
- local administrator rights on the server
- DB_OWNER rights on the farm's SharePoint databases
- Read, Write, and Update rights in the shared directory where backups
are created
- SharePoint Foundation 2010 or SharePoint Server 2010
- It must be granted the SHAREPOINT_SHELL_ACCESS role via the
Add-SPShellAdmin CMDLET - DONE
- Full Control of the shared directory where backups are created - DONE
- The account that runs the SharePoint 2010 Timer Job (SPTimerV4.exe) service,
and the SQL Server instance's SQL Service account must have Full Control
of the shared backup storage directory - THis was not done Network Service was not added but now is.
Update - Checked the windows app log filled with errors like this Log Name: Application
Source: MSSQL$SHAREPOINT
Date: 25/03/2015 16:52:50
Event ID: 3041
Task Category: Backup
Level: Error
Keywords: Classic
User:
Computer:
Description:
BACKUP failed to complete the command BACKUP DATABASE SharePoint_AdminContent_e3
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="MSSQL$SHAREPOINT" />
<EventID Qualifiers="49152">3041</E
<Level>2</Level>
<Task>6</Task>
<Keywords>0x80000000000000
<TimeCreated SystemTime="2015-03-25T16:
<EventRecordID>46670</Even
<Channel>Application</Chan
<Computer></Computer>
<Security UserID="S-1-5-21-172853666
</System>
<EventData>
<Data>BACKUP DATABASE SharePoint_AdminContent_e3
<Binary>E10B00001000000014
</EventData>
</Event>
You are receiving an access denied error. In the scheduled task manager you can set which account the task should run as. That would be the access with access to the database.
ASKER
Do we need to grant privileges within SQL and to that SQL instance for the account that runs the task?
Presently it does not have any SQL access.
Presently it does not have any SQL access.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers will give it a shot.
ASKER
Ok working now with the permissions one of the reasons I hadn't added them is in the requirements above it looks like its asking to add them only in WSS or MOSS which we are not using. Its actually asking to add all in 2010 Foundation too.
Im backing up 500MB roughly now with no errors in the logs so im happy enough with this now.
Thanks Sneekco
Im backing up 500MB roughly now with no errors in the logs so im happy enough with this now.
Thanks Sneekco
Glad that is working for you.
Have fun!
Have fun!
ASKER
The issue fyi was caused by 2 things.
1. No SQL access on DB.
2. This access denied error was a windows permissions error on the output dir.
1. No SQL access on DB.
2. This access denied error was a windows permissions error on the output dir.