Sharepoint Service V3 schedule backup Help
Hi I'm new to Sharepoint Services and I'm now trying to find information on how to setup a schedule backup for my Sharepoint Service V3 . At present I'm manually using utility within SharePoint 3.0 Central Administration. Back ground I've have Windows 2003 Server R2 on a 64bit OS. I have default version on Microsoft SQL server install, Which I beleive is the Express. I've read articles describing using using STSADM within command in a BAT or CMD file to backup Sharepoint and use Task scheduler. I've also read that I can use Microsoft SQL server manager 2005 Express. QuestionIf I want to backup all information on a Sharepoint Service Server, Which way is the best way? Is there any documentation out there showing me how to do this? Can I use Microsoft SQL server manager 2005 Express to connect to Sharepoint Service Databases? Is there another way to schedule backupsAny Help Would be Great Thanks
June 13th, 2007 5:10pm
see http://technet2.microsoft.com/windowsserver/WSS/en/library/700c3d60-f394-4ca9-a6d8-ab597fc3c31b1033.mspx?mfr=true
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2007 6:03am
Thanks...... I've setup an automated backup using stsadm.exe within an *.VDS Script. I scheduled a tasks to run the script daily. But as I have noticed that after running script it backup all my current sites. AS one large file name <Site_name>.bak. If I compare in to when I manually backup all my Database IE( Content, Search, Administration) using the Utility within SharePoint 3.0 Central Administration the Files are different. There are a lot more smaller size files!I'm confused if my server did crash today can I recover all my sites and and Sharepoint Service Server setting with the STSADM or the backup DATADASE approach. Dean
June 14th, 2007 1:22pm
I have never gotten SharePoint to restore with the restore functionality inside of Central Admin. When I talked to MS they said they DO NOT offer config level restores. This to me somewhat makes the restore inside of Central Admin to very functional. I backup all of my DB's, note the names of my applications and the corrisponding content databases. Then I reinstall SharePoint, recreate the applications and restore the SSP(s). I have done and tested it a few times. It works perfectly.
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2007 2:17pm
Thanks DNS_Tommy! When you backup your DB's , what are you using, Central Admin or another utility. I've tried you use Microsoft SQL 2005 Express manager 2005 edition. But Whenever I try to connect I get the following error. An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider)I'm running this manager on my sharepoint Service box Using the database name as <Server>\Microsoft##SSEEAny Idea? Is there another Utility to backup my databases?
June 15th, 2007 4:45pm
Enable the remote connections in the sql server surface manager. Even after that if you have problems, check the firewall. Create exceptions in the firewall to allow sql server connections.
Thanks,
Prashanth
Free Windows Admin Tool Kit Click here and download it now
June 19th, 2007 8:48am
Thanks PrashanthWhen I first came cross this issue I followed the direction in this document
How to configure SQL Server 2005 to allow remote connectionshttp://support.microsoft.com/kb/914277 But when you install Microsoft SQL Server 2005 Embedded Edition (Default install of Sharepoint Service V3 ) you don't get the GUI installed nor the utility under services. As I'm running the manager on the server , I can't see it being an firewall issue but just in case I did make an exception for SQL Server.exe. Still the same error. Does anyone know how to enable remote connections with Microsoft SQL Server 2005 Embedded Edition which get installed with WSS 3Any help would be greatDean
June 19th, 2007 12:28pm
Hey Dean,
First, the bad news. I have enabled remote connections in the past with the Embedded Edition, and it seems to be blocked internally. Traditionally the SharePoint database is not meant to be managed directly via SQL, and it would not surprise me if Microsoft declaritively blocked access to it. SQL Management Studio Express cannot connect to the database directly on the same box either.
The good news. stsadm -o backup does a full backup per site collection. Assuming you have few site collections and little configuration to backup, this will probably be fine by itself. Beyond the database, make sure you also backup any customizations done (through the 12 hive), as well as your Application Pool, and Web Site configurations (via the IIS, Save Configuration to file option). Hope this helps!
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2007 1:28am
Hi there
Check this out: http://www.mcpblog.net/Lists/Posts/Post.aspx?ID=10
June 24th, 2007 9:05pm
Hi Dean,
I guess were desiring the same thing and facing the same problem.
My wish goes a little further... i created a folder structure to write my sharepoint backups. Something like this:
Year --- Month --- Last Friday. Cause a i backup every friday. The last backup of the month i write to an external medium.
I tried to use a script that i read in the book of Mark E. Grew (creating client extranets with SharePoint 2003). and it sounds like this:
*************************************
' Back up the WSS sites...
' -
Const STSADM_PATH = _
"C:\Program Files\Common Files\Microsoft Shared\" & _
"web server extensions\60\BIN\stsadm"
Dim objFso, objFolder, objFiles, objFile, objShell, objExec
Dim strResult, objXml, objSc, objUrl, strUrl
Dim strFileName, strCmd
Set objFso = CreateObject("Scripting.FileSystemObject")
' Delete all backup files currently present in the backup folder.
Set objFolder = objFso.GetFolder("\\extwss01\WSSBackups\")
Set objFiles = objFolder.Files
For Each objFile in objFiles
objFile.Delete(True)
Next
' Retrieve all site collections in XML format.
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec(STSADM_PATH & " -o enumsites -url http://extwss01/")
strResult = objExec.StdOut.ReadAll
' Load XML in DOM document so it can be processed.
Set objXml = CreateObject("MSXML2.DOMDocument")
objXml.LoadXML(strResult)
' Loop through each site collection and call stsadm.exe to make a backup.
For Each objSc in objXml.DocumentElement.ChildNodes
strUrl = objSc.Attributes.GetNamedItem("Url").Text
strFileName = "\\extwss01\WSSBackups\" & _
Replace(Replace(strUrl, "http://", ""), "/", "_") & _
".bak"
strCmd = STSADM_PATH & " -o backup -url """ + strUrl & _
+ """ -filename """ + strFileName + """"
objShell.Exec(strCmd)
Next
WScript.Echo "WSS Backup complete."
*************************************************************
What i do not know is wich strings or commandsexactly do i have to change to make it work within my domain. Off course i changed the servername and backfolder.
But the scripts runs and i dont get the result i expected. if it works i can setup or schedule multiple tasks to write the backups in the wright folder according to my backup schema (using the same script wiht different backup locations).
Can somebody please help us out here?
Already thanks for reading!
Evaldo Santos
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2007 6:48am
I'm hoping you are referrign to WSS 2.0 backup, instead of WSS 3.0 backup. Here is an updated script:
Code Snippet
' Back up the WSS sites...
' -
Const STSADM_PATH = _
"C:\Program Files\Common Files\Microsoft Shared\" & _
"web server extensions\60\BIN\stsadm"
Const BACKUP_DIR = "E:\WSSBackups\"
Const SHAREPOINT_URL = "http://extwss01/"
Dim strBackupFolder
strBackupFolder = BACKUP_DIR & CStr(Year(Now())) & "\" & _
CStr(Month(Now())) & "\" & CStr(Day(Now()))
Dim objFso, objFolder, objFiles, objFile, objShell, objExec
Dim strResult, objXml, objSc, objUrl, strUrl
Dim strFileName, strCmd
Set objFso = CreateObject("Scripting.FileSystemObject")
' Delete all backup files currently present in the backup folder.
If objFso.FolderExists(strBackupFolder) Then
Set objFolder = objFso.GetFolder(strBackupFolder)
Set objFiles = objFolder.Files
For Each objFile in objFiles
objFile.Delete(True)
Next
Else
CreateBackupFolder strBackupFolder, objFso
End If
' Retrieve all site collections in XML format.
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec(STSADM_PATH & " -o enumsites -url " & SHAREPOINT_URL)
strResult = objExec.StdOut.ReadAll
' Load XML in DOM document so it can be processed.
Set objXml = CreateObject("MSXML2.DOMDocument")
objXml.LoadXML(strResult)
' Loop through each site collection and call stsadm.exe to make a backup.
For Each objSc in objXml.DocumentElement.ChildNodes
strUrl = objSc.Attributes.GetNamedItem("Url").Text
strFileName =strBackupFolder & "\" & _
Replace(Replace(strUrl, "http://", ""), "/", "_") & _
".spb"
strCmd = STSADM_PATH & " -o backup -url """ + strUrl & _
+ """ -filename """ + strFileName + """"
objShell.Exec(strCmd)
Next
WScript.Echo "WSS Backup complete."
Sub CreateBackupFolder(strFolderName, fs)'This subroutine creates the appropriate folder structure' if it does not already exist
If Left(strFolderName, 2) = "\\" Then folderparts = Split(strFolderName, "\") strCurrent = "\\" & folderparts(2) & "\" & _ folderparts(3) & "\" folderparts = Split(Right(strFolderName, Len(strFolderName) - _ Len(strCurrent)), "\") Else folderparts = Split(strFolderName, "\") strCurrent = folderparts(0) & "\" folderparts = Split(Right(strFolderName, Len(strFolderName) - _ Len(strCurrent)), "\") End If For Each folderpart In folderparts strCurrent = strCurrent & "\" & folderpart If Not fs.FolderExists(strCurrent) Then fs.CreateFolder strCurrent End If NextEnd Sub
For those of you who do not know coding that well, you can change the following parameters to get this to work:
BACKUP_DIR - your appropriate backup location (which can be \\SERVERNAME\SHARENAME as well).
STSADM - change the 60 to 12 if you are using WSS 3.0 instead
strBackupFolder - update the code to use any other backup folder scheme you want.
I did not understand the --> Last Friday portion, but hopefully this will be enough to get you rolling. Good luck!
June 27th, 2007 8:55am
Right, so how/where exactly would I run this script.
Do I have to set some permisions...
etc.
Free Windows Admin Tool Kit Click here and download it now
June 28th, 2007 8:00am
You run that script using the at or Scheduled Tasks console on the WSS / MOSS server.
June 28th, 2007 12:15pm
"Scheduled Tasks console on the WSS '
Where can u exactly found the scheduled tasks? In the WSS 3.0 Central Administration? (Operatios or Application Management?
Thanks Anyway.
Evaldo Santos
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2007 6:16pm
Use Start -> Control Panel -> Scheduled Tasks
July 6th, 2007 6:44pm
Hi there.
How do I save the file...what extension, etc.? Does it have to be compiled??
Denise
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2007 12:49pm
Save it as a vbs file. No compile needed.
July 11th, 2007 12:55pm
Please try the following script to take backup , it will create a dat file with backup"todays date" in c:\Site_backup folder.You can restore the whole site with user permissions to another machine with this backup.Regards,Aji JoseSet mm=%DATE:~4,2%Set dd=%DATE:~7,2%Set yyyy=%DATE:~10,4%cd "\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"stsadm.exe -o backup -url https://localhost -filename c:\Site_backup\backup%yyyy%-%mm%-%dd%.datexit
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2007 2:17pm
Aji, that is great for a single site collection, but if multiple site collections exists you would need to put in more stsadm.exe operations.
July 11th, 2007 8:09pm
I receive an error in line 1. it says character 8 is invalid.
How do i fix it?
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2007 4:14am
Evaldo, I am sure , it will work , pls try to copy and paste the script and save it as a batch file.
July 12th, 2007 5:18pm
Ooops i saved it as a .vbs file and tried to run it directly. And is this batch compatible with sharepoint 3.0 (WSS 3.0)?
Wha r exactly ur recomendations?
Save as .bat file and than run or schedule a task in windows to run the batch file?
Thanks Jose
Evaldo Santos
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2007 5:27pm
Evaldo,1.Save it as a .bat file 2.Schedule a task in Windows to run this file .3.Use Administrator's accout to run this task.Thanks,Aji.
July 12th, 2007 5:47pm
Hi Jose,
The batch runs, but on my c drive i see nothing. Even the used space of the drivedoes not increase. No hidden folders or else.
I try to point the backup folder to a directory where the group SQLServer2005MSSQLUser$SHAREPOINT$MICROSOFT##SSEE
has acces. Ill let u know.
Evaldo Santos
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2007 5:51am
Verify your batch file has the dash, and not the hyphen. Retype it in if necessary.
July 16th, 2007 6:53am
Right, good point.
How would you code that...toget those other site collections??
Denise
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2007 7:06am
I copied and run the batch exactly like Jose posted it here:
Set mm=%DATE:~4,2% Set dd=%DATE:~7,2% Set yyyy=%DATE:~10,4% cd "\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"stsadm.exe -o backup -url https://servername -filename c:\Site_backup\backup%yyyy%-%mm%-%dd%.datexit
Can u see something wrong up in here?!
Crazy enough other people claim that this batch works...
Evaldo Santos
July 16th, 2007 10:30am
Create one directory named Site_backup in c: , then try .
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2007 4:56pm
I got it Jose
The URL is wrong... at least for my case: httpS://servername
I just removed the S and few seconds later i got the backup done.
There are two facts that i have to report:
The name of the file sounds like this backup-7--00.dat (it should stamp the date)
The sise of the backup is made with your batch is 367MB but the backup made with sharepoint central administration is 485MB. Does this batchbackupthe entire webapplication or just the first site?
I will try to figure out in my test environment. i will try to backup and restore as well.
Great job Jose
Thanks,
Evaldo Santos
July 17th, 2007 11:09am
The batch file only backs up the root site collection. If you have additional site collections (usually listed as /sites/<somename>) they are not backed up as part of that process. This has gone well beyond the scope of the original post. It might be time to create a new Thread if you have additional concerns about this tangent on the original post.
Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2007 9:48pm
I have run this script and gotten serveral .spb files. For my company's "My Site" pages, it seems to have created a .spb file for each employee's page. My question now is, how can I restore all of these files to create my full SharePoint site again? I would like to move the data to another server, but each time I try it doesn't come out correctly. Is there a script or directions for doing this? Thanks
July 27th, 2007 4:21pm
The command:
stsadm -o backup -directory <UNC path or local drive> -backupmethod <full or differential>
Will backup the entire sharepoint farm.
see:
http://technet2.microsoft.com/windowsserver/WSS/en/library/700c3d60-f394-4ca9-a6d8-ab597fc3c31b1033.mspx?mfr=true
Free Windows Admin Tool Kit Click here and download it now
July 30th, 2007 7:23am
try this
it 'll be helpfull
\\.\pipe\mssql$microsoft##ssee\sql\query
from SQL Server Management Studio
August 6th, 2007 7:02am
Hello Neil ,Could you please specify , how can we restore with this backup ?...Regards,Aji
Free Windows Admin Tool Kit Click here and download it now
August 22nd, 2007 5:48pm
Hello Essam ,
Great , that is really helpfull .
Thanks,
Aji
August 28th, 2007 2:58pm
ESSAM NADA! Thank for the, this allowed me to connect to the Database using SQL management STUDIO! Thanks you! 2 days of searching!
\\.\pipe\mssql$microsoft##ssee\sql\query
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2012 11:51am


