Scheduling automatic backup in Sharepoint 2007

Scheduling Daily Site level backup

————————————–

Step by step

 

1) First you need to crate .bat file. In which you have to write Stsadm command for taking backup. Open Notepad file

 

Code:

 

:echo*******************************

:echo Site level Backup

:echo*******************************

 

cd “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\”

stsadm -o backup -url http://litwaredemo:1234 -filename C:\DailyBackup\NewBackUp_%date:~4,2%_%date:~7,2%_%date:~10,4%.dat -overwrite

 

Now save the notepad file with .bat extension (eg: Dailybackup.bat).

 

2) Now create Scheduling for you daily backup. For this go to

Start ->Programs -> Accessories-> System Tools -> Scheduled Tasks

 

3) Doubled Click on Add Scheduled Task

 

4) Click Next

 

5) Click on Browse button and browse your .bat file and click Open.

 

6) Type the Name and Select Scheduled according to your requirement, but for now select “Daily” and Click Next.

 

7) Provide the time to start taking backup for your site daily (eg: 8:00pm) and Select radio button Every Day & Click Next.

 

8) Enter Username, Password & Confirm Password and click on Next.

 

9) Click on Finish.

 

********* You have successfully Created Scheduled for taking backup for site daily************

 

:echo*******************************

:echo Restoring Site

:echo*******************************

 

For restoring site backup. Open command prompt and type the following

 

cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>

stsadm.exe -o restore -url http://litwaredemo:100 -filename C:\DailyBackup\NewBackUp_05_14_2009.dat -overwrite

 

Operation completed successfully.

 

Now Reset the IIS

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>iisreset

 

Once you reset IIS. It’ll display messages like

Attempting stop…

Internet services successfully stopped

Attempting start…

Internet services successfully restarted

 

********* You have successfully restored site ************

 

 

:echo*******************************

:echo SubSite level Backup

:echo*******************************

 

Subsite level backup and restore done by using Stsadm Export and Import commands.

 

Syntax:-stsadm -o export -url <fullurl which u want to export> -filename <location:filename.dat> -includeusersecurity

 

Ex:-cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>

stsadm.exe -o export -url http://litwaredemo:100/mysubsite -filename D:\SubsiteBackup\subsiteBackUp_%date:~4,2%_%date:~7,2%_%date:~10,4%.dat

-includeusersecurity.

***************************************************************************

 

:echo*******************************

:echo SubSite level Restore

:echo*******************************

Syntax:-stsadm -o import -url <destination url> -filename <location where u stored.dat file>

 

 

Ex:-C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o import -url http://eccms41s0488:100/mysubsite2 -filename D:\SubsiteBackup\

subsiteBackUp_05_19_2009.dat -includeusersecurity

————————————————————————————————

 

Scheduling Daily Farm level backup

————————————–

Step by step

 

Note: Please follow the same steps but the .bat file code is different and that code is…

 

: echo*******************************

:echo Farm level Backup

:echo*******************************

 

cd “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\”

stsadm -o backup -directory \DailyBackup -backupmethod full -overwrite

 

Note: If you want to take backup as differential the instead of “Full “ please use Differential…

Advertisements

One response to this post.

  1. Posted by Sunita on July 23, 2010 at 8:24 pm

    Hi

    Excellent post. G8 It solved my problem

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: