Showing posts with label SP Installer. Show all posts
Showing posts with label SP Installer. Show all posts

Tuesday, June 16, 2009

Automatic take sharepoint site backup using batch file and scheduler

It is not possible to schedule sharepoint backup from sharepoint central admin site.
Below is process to take backup using batch file and after running schedule on specific time.

1. Open notepad and paste below code.

@echo off

@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"

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

@echo off

md "%DATE:/=_%"

stsadm -o backup -url "http://localhost:8080" -filename "E:\MOSS_Backup\%DATE:/=_%.bak"

echo completed

2. Save it as AutoBackup.bat (Change your site name )

Set Task schedular for this batch file and take backup on schedule time.


Saturday, January 3, 2009

Deploy master page in sharepoint 2007/wss 3.0

I used the sample master pages at http://office.microsoft.com/en-us/sharepointdesigner/HA102223711033.aspx in several Feature Stapling/Receiver demonstrations to update the master page on both site collections and Webs.

Usage:

Copy the Master Page solution file like Master.wsp to a location on a Web front-end computer.

Open a Command Prompt and change directories to %commonprogramfiles%\Microsoft Shared\Web Server Extensions\12\BIN\.

Run STSADM -o addsolution -filename "\Master.wsp" and wait for the operation to complete.

Run STSADM -o deploysolution -name "Master.wsp" -immediate -force -allowGacDeployment and wait for the operation to complete.

Run STSADM -o execadmsvcjobs and wait for the operation to complete.

NOTE Existing site collections will not be affected and can be modified either through SPD or the SharePoint UI.

Newly created site collections and Webs will receive the Clarity master page.


Sunday, November 23, 2008

How to Deploy SharePoint WebParts

There are several ways to skin the Webparts deployment cat, each with a few pluses and minuses.

Method 1 - manual

  • Copy assembly DLL to either
    - /bin directory for a given IIS virtual server (e.g., c:\inetpub\wwwroot\bin)
    - Global Assembly Cache (e.g., c:\windows\assembly)

  • Copy DWP file to C:\Inetpub\wwwroot\wpcatalog

  • Copy resources to
    - For GAC-registered parts, C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources
    - For Web Parts in the /bin directory, C:\Inetpub\wwwroot\wpresources

  • Adjust web.config
    - Register as SafeControl
    - Select Code Access Security settings


Method 2: CAB File

  • CAB file should contain
    -Assembly DLL
    -DWP file(s)
    -Manifest.XML
    -Resource files (if needed)
  • CAB won't contain
    - Code Access Security settings

  • Server-side object model has methods for deploying such a CAB file

  • Deploy with STSADM.EXE
    Located in C:\Program Files\Common Files\Microsoft Shared\web server extensions0\BIN
    Add it to your path
    Stsadm -o addwppack -filename filename [-globalinstall] [-force]

Friday, August 29, 2008

SP Installer Batch File

Here is the sharepoint installer batch file that you can copy Master page,Application page, create new folder , generate new site using command line and store the site using command line.

echo Copying the feature...

:: Copy Master File

copy /Y simple1.master "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\Template\Layouts\"

:: Copy aspx file

copy /Y LoginUser.aspx "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\Template\Layouts\"

:: Make Folder for the UserControl

mkdir "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\Template\Layouts\UserControl"

:: Copy the UserControl into the UserCOntrol Folder

copy /Y RecoverPassword.ascx "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\Template\Layouts\UserControl\"

:: Copy Images and Css

copy /Y *.gif "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\Template\Layouts\1033\Images\"

copy /Y *.css "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\Template\Layouts\1033\styles\"

echo Activating the feature...

pushd %programfiles%\common files\microsoft shared\web server extensions\12\bin

:: Create New Site using Command Line

stsadm -o extendvs -url "http://sps:16333" -ownerlogin "serverpsp\trushar" -owneremail "trushar@sps.com" -dn "SP_test" -apcreatenew -apidname "TEST1" -apidtype configurableid -apidlogin "serverpsp\trushar" -apidpwd "trushar"

:: Copy WebConfig,DLL,Pages

copy /Y *.dll "%inetpub%\Inetpub\wwwroot\wss\VirtualDirectories\16333\bin\"

copy /Y web.config "%inetpub%\Inetpub\wwwroot\wss\VirtualDirectories\16333\"

mkdir "%inetpub%\Inetpub\wwwroot\wss\VirtualDirectories\16333\UserControl"

copy /Y myacc.ascx "%inetpub%\Inetpub\wwwroot\wss\VirtualDirectories\16333\UserControl\"

:: Restore New Site

stsadm -o restore -url "http:// sps:16333" -filename "C:\TestBKP.dat" -overwrite