::***********************************************************************************
:: Backing up and restoring a web (subsite) in any top level site
::***********************************************************************************
Backs up or restores a SharePoint Web site.
Usage (backup): smigrate -w
Usage (restore):
smigrate -r -w
Operations and Parameters:
-f Backup filename - required. Specify a filename with the extension .fwp.
-e Exclude subsites during backup - optional. No parameters.
-r Restore - optional. No parameters.
-w Website URL - required. Valid URL to a SharePoint Web site.
-x Exclude security during restore - optional. No parameters.
-y Confirm that you want to overwrite an existing backup file.
-u Administrator username.
-pw Administrator password.
Specify * as the password to be prompted for a password.
Example backup:
smigrate -w http://server -f backup.fwp
smigrate -w http://server -f c:\backups\backup.fwp
smigrate -w http://server -f \\share\folder\backup.fwp
smigrate -w http://server -f c:\backups\backup.fwp -e -y
Example restore:
smigrate -r -w http://server -f backup.fwp
smigrate -r -w http://server -f c:\backups\backup.fwp
smigrate -r -w http://server -f \\share\folder\backup.fwp
smigrate -r -w http://server -f c:\backups\backup.fwp -x
****************************************************************************************************
::***********************************************************************************************
:: Backing up a
echo %0 STARTING on %COMPUTERNAME%.. > %0.log
echo. | date | find /I "current" >> %0.log
echo. | time | find /I "current" >> %0.log
echo. >> %0.log
set LOC=C:\Program Files\Common Files\Microsoft Shared\Web server extensions\60\Bin
set DRV=E
::
:: NOTE: Has to run as service account else STSADM fails with:
:: Cannot connect to the configuration database.
::***********************************************************************************************
set SITE=BizProcesses
echo %0 : backup of site '%SITE%' >> %0.log
::
if exist E:\backup goto DRIVEE
echo E:\backup does NOT exist, so we'll try writing to D:\backup. >> %0.log
set DRV=D
goto RUNIT
::--------------------------------------------------
:DRIVEE
echo E:\backup exists, so we'll write %SITE%.dat there. >> %0.log
::--------------------------------------------------
:RUNIT
"%LOC%"\stsadm -o backup -url
::
::
echo. >> %0.log
echo %0 ENDING. >> %0.log
echo. | time | find /I "current" >> %0.log
::************************************************************************************************
::***********************************************************************************************
:: Restoring a site collection from backup
::***********************************************************************************************
:: Restore.bat - restore /sites/.. from backup
::
echo %0 STARTING on %COMPUTERNAME%.. > %0.log
echo. | date | find /I "current" >> %0.log
echo. | time | find /I "current" >> %0.log
echo. >> %0.log
set LOC=C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\Bin
set DRV=E
::
:: NOTE: Has to run as service account else STSADM fails with:
:: Cannot connect to the configuration database.
::
::
::***********************************************************************************************************
set SITE=BizProcesses
::
::
echo %0 : STSADM restore site '%SITE%'. >> %0.log
::
if exist E:\backup goto DRIVEE
echo E:\backup does NOT exist, so we'll read from D:\backup. >> %0.log
set DRV=D
goto RUNIT
::--------------------------------------------------
:DRIVEE
echo E:\backup exists, so we'll read %SITE%.dat from there. >> %0.log
::--------------------------------------------------
:RUNIT
"%LOC%"\stsadm -o restore -
::
::"%LOC%"\stsadm -o restore
::
echo. >> %0.log
echo %0 ENDING. >> %0.log
echo. | time | find /I "current" >> %0.log
::***********************************************************************************************************
::************************************************************************************************************
Database attach migration from Sharepoint server 2003 to MOSS
::************************************************************************************************************
Migrating from SPS2003 to SharePoint 2007 on Database attachment method involves the below 4 tasks.
Run PreScan.exe in SPS 2003 server.
Take the back up of content database of SharePoint Portal Server 2003.
Restore the content databases back up on SQL Server of MOSS 2007.
Create web application in MOSS 2007.
Attach the SPS 2003 databases to MOSS 2007.
Run Prescan.exe in SPS 2003 Server
Download & Run the prescan.exe as below in command prompt:
prescan.exe /c preupgradescanconfig.xml /all
Download URL: http://www.microsoft.com/download/en/details.aspx?DisplayLang=en&id=22806
Backup Databas in sql Server
1. In Microsoft SQL Server Management Studio, right-click the name of the database that you want to
2. In the left pane, click Options.
3. In the right pane, under Other options, under State, next to Database Read-Only, click the down
Restore back up on SQL Server attached with MOSS 2007:
The first step in restoring database is to create a database in SQL Server 2005. Let the newly created
1. Expand Database “Portal_Site_Restore”, right-click the database you want to restore, point to Tasks,
2. On the General page, the name of the restoring database appears in the To database list box.
3. In the To a point in time text box (if using SQL Server 2005 Enterprise Edition), retain the default
4. To specify the source and location of the backup sets to restore, click From device, and then
5. In the Select the backup sets to restore grid, select the backup path.
6. From the options tab, select “overwrite existing database”.
7. Specify the paths for .ldf and .mdf in the options tab.
8. Click OK to start the restore process.
Create website in IIS
Run command in PS or in command tool
stsadm.exe -o addcontentdb -url http://servername:1234 –databasename Portal_Site_Restore
stsadm.exe -o addcontentdb
-url
-databasename
[-databaseserver
[-databaseuser
[-databasepassword
[-sitewarning
[-sitemax
::**********************************************************************************************************
Database attach migration from Sharepoint server 2007(MOSS) to Sharepoint Enterprise 2010
::**********************************************************************************************************
A. Run prechecker
B. Backup Database
On the database server, click Start, point to All Programs, point to Microsoft SQL Server 2008, and then
In the Connect to Server box, fill in the connection information, and then click Connect.
After you connect to the appropriate instance of the SQL Server 2008 Database Engine, in Object
Expand Databases, right-click the database that you want to back up, point to Tasks, and then click
In the Source area, in the Database box, verify the database name.
In the Backup type box, select Full.
Under Backup component, select Database.
In the Backup set area, in the Name text box, either accept the default backup set name or type a new
In the Destination area, specify the type of backup destination by selecting Disk or Tape, and then
Click OK to start the backup process.
C. To restore a backup copy of a database in SQL Server
After you connect to the appropriate instance of the SQL Server 2008 Database Engine, in Object
Right-click Databases, and then click Restore Database. The Restore Database dialog box appears.
In the Restore Database dialog box, on the General page, type the name of the database to be
In the To a point in time text box, retain the default (Most recent possible).
To specify the source and location of the backup sets to restore, click From device, and then click
In the Specify Backup dialog box, in the Backup media box, be sure that File is selected.
In the Backup location area, click Add.
In the Locate Backup File dialog box, select the file that you want to restore, click OK, and then,
In the Restore Database dialog box, under Select the backup sets to restore grid, select the Restore
In the Restore Database dialog box, on the Options page, under Restore options, select the Overwrite
Click OK to start the restore process.
D. Create Website in IIS
E. You can use either the Mount-SPContentDatabase cmdlet in Windows PowerShell or the
Mount-SPContentDatabase -Name
::***********************************************************************************
::************************************************************************************
We need to use tool to achive this.
Personally I found Quest tool better than Metalogix
No comments:
Post a Comment