Welcome to the New WSS3 / MOSS2007 Site - This replaces the old WSS2 site, You can still find it here
In September 2007, my Site was upgrated from WSS2 (DK + UK Language) to WSS3 (DK + UK Language), a process that ran similar (or as a test) for my firms upgrades, as the 2 systems was very alike.
How did I do it? Well, as You may know, upgrading MOSS and WSS are no walk in the park, but read on: My WSS2 To WSS3 Upgrade
Blog entries:
10-02-2010: Website speed (or lack of same):
As default it only applies to LCID 1033 (fuck)- both with a few steps this can be solved:
Apply the changes from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\XXXX\SPTHEMES.XML (for some reason the CONTOSO entry does not work for me, and I had to leave it out)
Warning - this is [business as usual?] a hack into the files of WSS/MOSS, and is not supported in any way, retracting the Theme features will not clean up You manually copied files!
08-09-2009: I am playing around with a complete SharePoint document export, both for a purpose on Work and possibly yo migrate to Drupal. To make it pretty simple, a VBS script is used. The task is pretty simple, main issue is to filter out Sharepoint Stuff like ghosted pages and filenaming versions of documents; - I am not sure all exections are handled yet:
Function RunSQL(sql)
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockBatchOptimistic = 4
On Error Resume Next
Dim RS
Set RS = CreateObject("ADODB.Recordset")
RS.CursorLocation = adUseClient
RS.Open sql, ConnectString, adOpenStatic, adLockBatchOptimistic
Set RS.ActiveConnection = Nothing
Set RunSQL = RS
On Error Goto 0
End Function
Function CreatePath(CurStartPath,thePath)
Dim NextLevel
If InStr(thePath,"\")>0 Then
PathArray=Split(thePath,"\")
NextPath=PathArray(0)
NextLevel=True
Else
NextPath=thePath
NextLevel=False
End If
If Not FSO.FolderExists(CurStartPath+NextPath) Then FSO.CreateFolder(CurStartPath+NextPath)
If NextLevel Then
RemainingPath=Right(thePath,Len(thePath)-Len(NextPath+"\"))
CreatePath CurStartPath+NextPath+"\",RemainingPath
End If
End Function
Dim RS,sql,ConnectString,RelPath,StartPath
ConnectString="Provider=SQLOLEDB; Data Source=AALIITNT08; Initial Catalog=Sharepoint_Content; User Id=sa; Password=PasswordHere;Network Library=DBMSSOCN"
StartPath="P:\SharepointExport\"
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
FileCount=0
Set FSO=CreateObject("Scripting.FileSystemObject")
Set LogFile = FSO.OpenTextFile(StartPath+"ExportLog.txt",2,true)
' Export All Documents from AllDocs
sql="SELECT Id,DirName,Leafname FROM AllDocs WHERE dirname NOT LIKE '' AND Leafname NOT LIKE '' ORDER BY DirName,Leafname"
Set RS=RunSQL(sql)
While Not RS.EOF
RelPath=Replace(RS("DirName"),"/","\")
If Not Left(RelPath,1)="_" And InStr(RelPath,"_catalogs")=0 And InStr(RelPath,"_layouts")=0 Then
DocId="'"+RS("Id")+"'"
DocFileName=RS("LeafName")
DocDirName=RS("DirName")
DotPos=InStrRev(DocFilename,".")
If DotPos=0 Then
DocExtension=""
DocShortFilename=DocFilename
Else
DocExtension=Right(DocFilename,Len(DocFilename)-DotPos)
DocShortFilename=Left(DocFilename,Len(DocFilename)-(Len(DocExtension)+1))
End If
sql="SELECT COUNT(*) FROM AllDocVersions WHERE Id="+DocId+" AND Content IS NOT NULL"
Set RS2=RunSQL(sql)
On Error Resume Next
DocVersions=CInt(RS2(0))
If Err Then LogFile.WriteLine("Error: "+Replace(DocSaveFilename,"/","\")+","+DocId)
If DocVersions>0 Then
sql="SELECT * FROM AllDocVersions WHERE Id="+DocId+" AND Content IS NOT NULL"
Set RS2=RunSQL(sql)
s=0
While Not RS2.EOF
CreatePath StartPath,RelPath
DocVersion=CStr(RS2("Version")/512)
DocTimeCreated=RS2("TimeCreated")
'Create Stream object
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")
'Specify stream type - we want To save binary data.
BinaryStream.Type = adTypeBinary
'Open the stream And write binary data To the object
BinaryStream.Open
'On Error Resume Next
BinaryStream.Write RS2("Content")
'If Err Then msgbox DocDirName+DocFileName+CStr(DocVersions)
'Save binary data To disk
If s=0 Then
DocSaveFilename=StartPath+RelPath+"\"+DocShortFilename+"."+DocExtension
s=1
Else
DocSaveFilename=StartPath+RelPath+"\"+DocShortFilename+" (version "+DocVersion+")."+DocExtension
End If
BinaryStream.SaveToFile DocSaveFilename,adSaveCreateOverWrite
LogFile.WriteLine(Replace(DocSaveFilename,"/","\")+","+CStr(DocTimeCreated))
RS2.MoveNext
FileCount=FileCount+1
Wend
End If
End If
RS.MoveNext
Wend
LogFile.Close
Msgbox "Finish. Files saved: "+CStr(FileCount)
18-09-2009: Back on track, for the last long time, my frontpage has moved to a right-alignment, and I could not find out why. After 10 hours of investigation, FireFox'ing with Web Developer etc etc I found the [stupid] error, a missing quote in the default.aspx - SUCKS!!! But no-one to blame but meself...
25-03-2009: Ran into a "tough" situation, a XLS document named MACH IP VLAN.xls was corrupted and the user has tried to save it and in the process he has deleted the document from the Document Library (hence including all versions) and uploaded a new that also was corrupted...
So - No document, no versions and nothing(!) in the recycle bin (have to figure out why not)...so....what to do?
Well, a database restore and pointing web frontend to the restored database was out of the question, the database restore in another location (another MS SQL server) was no real problem, but I still had to figure out to get the binary data out...
After a bit of "Woosaaaa" - I started to examine was was in the current database first:
SELECT * FROM AllDocs WHERE LeafName = 'MACH IP VLAN.xls'
This gave 2 rows (versions) with 2 id's: 786e66d9-7b31-4e77-91ce-4abe3915864b and 87b10e0e-989b-4aff-97f3-7b0f57c276e1
So the next query was:
SELECT * FROM AllDocVersions WHERE (Id = '87b10e0e-989b-4aff-97f3-7b0f57c276e1')
ORDER BY TimeCreated DESC
This gave a lot of versions of the document:
| ec66704f-0276-4d6e-87eb-02fa57fb5625 |
87b10e0e-989b-4aff-97f3-7b0f57c276e1 |
205824 |
24-03-2009 06:31:46 |
| ec66704f-0276-4d6e-87eb-02fa57fb5625 |
87b10e0e-989b-4aff-97f3-7b0f57c276e1 |
205312 |
23-03-2009 22:09:19 |
| ec66704f-0276-4d6e-87eb-02fa57fb5625 |
87b10e0e-989b-4aff-97f3-7b0f57c276e1 |
204800 |
23-03-2009 14:35:05 |
| ec66704f-0276-4d6e-87eb-02fa57fb5625 |
87b10e0e-989b-4aff-97f3-7b0f57c276e1 |
204288 |
12-03-2009 10:47:41 |
So I created a small ASP site ( this is the simplest version possible, could need some shining..) using stuff from my Modus-Operandi product to retrive and save the Content column using this url:
/Default.asp?id=87b10e0e-989b-4aff-97f3-7b0f57c276e1&version=25824&extension=xls
The files for the ASP Site:
Global.asa
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows Library" -->
<script language="VBScript" runat="Server">
Sub Application_OnStart
Application.Lock
Application("ActiveUsers") = 0
Application("ConnectString")="Provider=SQLOLEDB; Data Source=AALIITNT08; Initial Catalog=Sharepoint_Content; User Id=sa; Password=PasswordHerei;Network Library=DBMSSOCN"
Application.UnLock
End Sub
</script>
DBConnect.asp:
<%
' *********************************************************
' Created and with copyright 2002-2004 by notezone
'
' For professional use, visit www.modus-operandi.dk
Function RunSQL(sql)
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockBatchOptimistic = 4
On Error Resume Next
Dim RS
Set RS = Server.CreateObject("ADODB.Recordset")
RS.CursorLocation = adUseClient
RS.Open sql, Application("ConnectString"), adOpenStatic, adLockBatchOptimistic
If Err.Number <>0 Then
' If Err.Number=-2147217900 AND InStr(LCase(sql),"ipageid='")>0 Then Response.Redirect("/Common/Error/iis/404b.asp")
Response.write "<b>SQL Error: <font color=red>" & Err.Number & " - " & Err.Description & "</b><br><br><font color=blue>" & sql
Response.write "<br><br>"
Response.write "<center><input type=button class=Button value=""Close"" onclick=""self.close();""> <input type=button class=Button value=""Go Back"" onclick=""history.go(-1);""></center>"
Set RS.ActiveConnection = Nothing
Response.End
End If
Set RS.ActiveConnection = Nothing
Set RunSQL = RS
On Error Goto 0
End Function
%>
Default.asp:
<!--#include file="dbconnect.asp"-->
<%
Dim RS,sql,bRead,bWrite,bChange,bChangeRights
iFileId=Request.QueryString("id")
iVersion=Request.QueryString("version")
vcExtension=Request.QueryString("extension")
If iFileId="" Or iVersion="" Or vcExtension="" Then
Response.write "Missing Parameter - I need id=xxxxx&version=xxxxx&extension=xxxx"
Response.end
Else
Response.write "Download the file <a href=""ServeFile.asp?id=" & iFileId & "&version=" & iVersion & "&extension=" & vcExtension & """>Here</a>"
End If
%>
ServeFile.asp:
<!--#include file="dbconnect.asp"-->
<%
Dim RS,sql,bRead,bWrite,bChange,bChangeRights
iFileId=Request.QueryString("id")
iVersion=Request.QueryString("version")
vcExtension=Request.QueryString("extension")
If iFileId="" Or iVersion="" Or vcExtension="" Then
Response.write "Missing Parameter"
Response.end
End If
sql="SELECT Content,Size FROM AllDocVersions WHERE id ='" & iFileId & "' AND Version=" & iVersion
Set RS=RunSQL(sql)
If Not RS.EOF Then
Select Case LCase(vcExtension)
Case "asf"
ContentType = "video/x-ms-asf"
Case "avi"
ContentType = "video/avi"
Case "doc"
ContentType = "application/msword"
Case "zip"
ContentType = "application/zip"
Case "xls"
ContentType = "application/vnd.ms-excel"
Case "gif"
ContentType = "image/gif"
Case "jpg", "jpeg"
ContentType = "image/jpeg"
Case "wav"
ContentType = "audio/wav"
Case "mp3"
ContentType = "audio/mpeg3"
Case "mpg", "mpeg"
ContentType = "video/mpeg"
Case "rtf"
ContentType = "application/rtf"
Case "htm", "html"
ContentType = "text/html"
Case "asp"
ContentType = "text/asp"
Case "zip"
ContentType = "application/zip"
Case Else
ContentType = "application/octet-stream"
End Select
Response.Clear
Response.Buffer=False
Response.AddHeader "content-disposition","attachment; filename=""thefile." & vcExtension & """"
Response.AddHeader "Content-Length", RS("Size")
' In a Perfect World, Your Client would also have UTF-8 as the default
' In Their Browser
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite RS("Content")
Response.Flush
End if
%>
--------------------------------------------------------
18-03-2009: Spooky, ran into serious problems of SP hanging at work and some DCOM error in the log:
--------------------------------------------------------
12-03-2008: I am doing some tricks to (hopefully) enhance performance:
--------------------------------------------------------
--------------------------------------------------------
--------------------------------------------------------
And truly a great day@work, I have finished the first "real" sharepoint Webparts, these will replace some JavaScript with ActiveX that I have used, mening that it was slow and only IE supported.
Now both a Customer Menu, a Menu based on a List and a IFrame'ish Webpart are .NEt programmed in C#. Some finetuning and errorhandling will be added, but they do work now:
--------------------------------------------------------
--------------------------------------------------------
16-01-2009 : An "old School" tip, to set all pages ( Also _layouts) in Edit mode:
Make a Link on the IE toolbar to the code: javascript:MSOLayout_ChangeLayoutMode(false);
16-01-2009 : Went to a course "Web Part Development" at Pilentum in Nørresundby, Denmark - the course was "homemade" and really, really good, nop M$ crap in it. And the teacher, Jakob Lund Krarup, was really dedicated. I will strongly recommend this to all upcomming/starting Web part developers.
--------------------------------------------------------