Sharepoint Backup & Restore

No Comments »

can be such a b**ch.. but it works pretty well one’s going. We had our new design template this week and I don’t know what happened since then but the servers (server farm of 3 went totally crazy. RPC failure, CPU IERR, disk prediction failure.. that was no good sign to say the least..

The servers were quite old and it took several years to get people interested into using Sharepoint and I just joined the organisation last year. It has plenty of error logs which couldn’t be explained by the consultant who took over the previous consultants few years ago..

I am no Sharepoint expert but really happy I took the Sharepoint Administration training course last year and tried the backup & restore in a test environment. Since we were thinking of changing the servers anyways, and we just set up a couple of thousand bucks in VMware (servers were to go P2V) I decided to install very from scratch and restore the last good backup.It took me a couple of hours to get this working again even if, for some reasons the restore wouldn’t work for the 2-3 initial times. That was weird, the first windows installation wasn’t done by me but it should have been a very straight forward installation which looked pretty fine.. but after 14hours struggling to make the restore work in different methods, mostly with the initial help of the external consultant, I scrapped everything up again, reinstall windows and follow strictly the steps I used in my initial test lab and it worked like a charm. I still need some help to figure out the special customizations that was made before I got there but it’s 99% up and running.

All that to say that my little Notepad file of 2.6 KB saved the day. I wouldn’t say a few Gigs of data ’cause the daily backups were running fine (that’s a 300Bytes batch file ),  but definitely all the effort put in by the Communications department to launch the new template and get people to work with it as the new academic year starts this week.

Document your stuff buddy!! you never know.. They are very basic but here are my two little life savers..

Daily Full Backup Batch File (run in a scheduled task at midnight or so)

@ECHO OFF
REM ***** Backup Sharepoint ******
c:
cd “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN”
set _day=%DATE:~0,3%
net use S: \\RemoteFileBackupServer\Sharepoint /PERSISTENT:NO
stsadm -o backup -url http://portal -filename S:\%_day%\portail.bak -overwrite > c:\temp\log.txt
Net USE S: /delete

Installation (Restore) procedure

- create service account (Domain User) and make it member of the administrators group of the server
- Join Domain
- login as service account (all installation must be made as this service account )
- Install IIS
- Install dotNet3
- Activate ASP.NET v2.0xx in Web service extensions of IIS Admin Manager
- Install (MSSQL Enterprise) – basically MSSQL Services & Workstation components to connect and view the databases
- Install Sharepoint
- Install SharePoint Language Pack French & Language Pack SP 1 & 2
- Check the Central Admin site and activate the services on the servers in order (if using a farm)
- Create an SSP with an Administration Web application
- Check if the profile import is working and it is pulling the information of all the users of the Domain / Entire Forest
- Create a web application for the Sharepoint users site (don’t create the site as suggested one the Web App is installed. )
- Move over the files from the old server to the new server including,
- web.config – in the web server c:\inetpub\wwwroot\…..\<site>\web.config
- Additional features from the application server c:\program files\common files\microsoft shared\web server extensions\12\TEMPLATE\FEATURES
- Special assembly file if any from c:\windows\assembly\gac_msil\

-Install the feature (execute command from the bin folder**)
stsadm -o installfeature -name <features> -force

**c:\program files\common files\microsoft shared\web server extensions\12\bin>

- Backup/ Restore Content database
stsadm -o restore -url http://portail -filename c:\portal.bak

Other method, apparently better, is to use the SQL back of the web application and just attach it to the newly created web application created on the new server.
- Backup and Restore the MSSQL Database (Should be the one with WSS_Content..)
- Go to Central Administration – Application Management – Content Database – add a Content database with the same name under the correct Web Application URL (top right)
OR use in command lines
stsadm -o addcontentdb -url htt://portail -databasename WSS_ Content_Portail -databaseserver PortalSQLServer

Re-assisgn the database (delete the empty newly created one and activate the restored one)

If you have other 3rd party web parts installed, make sure you know how they are installed and configured.

If you are changing the name of the URL, you might have to be assisted and go through all the customized file (e.g. web.config, 3rd party configuration) and replace the URL used.. (search & replace)

Launch the site, give it some time initially to start the page and it should work fine..

Posted on September 7th 2009 in IT/ Network Admin