MOSS MAN

Paul Zanbaka

Creating a small application from a Sharepoint Portal 2003 List
created by pzanbaka on Sunday, September 09, 2007 2:13 PM

 I will describe the steps you need to Create a small application from a Sharepoint Portal 2003 List. This will really come handy when your boss ask you to tweak A SPS list or if you just want to cut development time into 25% on a small straight forward app.

Create the list for help on this search the site on creating a list, and populate some items.
For this Example the list name will be “BlueDog”

Now the tricky part connect trough Enterprise Manager or Query Analyzer to the _SITE db. Run this query on WebParts Table
SELECT     *
FROM         WebParts
WHERE     (tp_DisplayName LIKE '%Blue Dog%')

Copy the tp_ListId field. In this example we will use this value for it>

All your data for this web part resides in the User Data Table. Since you already populated some fields. Run this Query on the UserData Table

SELECT     *
FROM         UserData
WHERE     (tp_ListId = '{1D2648E5-DDEB-4545-BF4D-E5B016C74156}')


You may want to create a view for your WebPart Data with you naming the fields using As.
See below:
CREATE VIEW dbo.View
AS
SELECT     nvarchar1 AS MyField1, nvarchar2 AS MyField2, datetime2 AS MyDate1,                      nvarchar3 AS Completed, tp_ID, tp_Modified AS Modified, tp_Created AS Created,
                      tp_HasAttachment AS HasAttachment
FROM         dbo.UserData
WHERE     (tp_ListId = '{1D2648E5-DDEB-4545-BF4D-E5B016C74156}')


This is it now you can create a whole application  based on this view.

2 Final Warnings:

First, Be very careful not to modify the field types in SPS this will affect the fields in your view.You may have to re-inspect your queries if you do.
Secondly, We do not know what Microsoft will do in the next version of SPS will they change their schema therefore destroying your Application Humm??
If you work for Microsoft Please answer me!.

with no comments
Filed under:
Customizing Sharepoint-Adding Template to Sharepoint Portal 2003
created by pzanbaka on Sunday, September 09, 2007 2:03 PM

How to add you own template to Sharepoint Portal Server. You first have to create a template, unfortunately we will not be discussing this in this article.
Once you have created the template make sure you save it as .stp extension.
For the sake of this example we will save it in here with the following name: C:\Templates\MyTemplate.stp
To add your template to the Portal Use the command line(Start|run|cmd)
cd [Drive]:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN
Where [Drive]:\ is the drive Sharepoint is installed on.
stsadm.exe -o addtemplate -filename "C:\Templates\MyTemplate.stp" -title "My Template"
You must restart IIS for theconfigurations to kick in
Use the iisreset command, it is quick usually less than 30 seconds.

Now when you create a site in Sharepoint your template will be displayed after Sharepoint’s templates. Notiuce when you mouse over the built in templates a description is displayed on the bottom.
To add description to your template:
stsadm.exe -o addtemplate -filename "C:\Templates\MyTemplate.stp" -title "My Template" -description "This template is Greaat You must use it blah blah blah!"

To delete a template use this command
stsadm.exe -o deletetemplate -title "My Template"
Again, You must also restart IIS.
Now you are ready to add your template so go customize a sharepoint site and save the site a template and add it to the portal.

with no comments
Filed under:
Why not create MCITP in SCCM or SharePoint 2007 (MOSS)?
created by pzanbaka on Thursday, September 06, 2007 6:21 PM

Microsoft new certifications MCITP allow IT pros to earn credentials equivalent to old school MCSE while focusing on a specific products.
Why not create a specialization for SCCM or MOSS?
Does anyone know if there are plans to do this in the near future?


These products certainly require specialization…
with no comments
Filed under:
Moving Sharepoint Portal Server 2003
created by pzanbaka on Tuesday, September 04, 2007 8:57 AM

For example from a Two Server farm to Standalone; or from development to production.
Install Sharepoint on the destination server but do not create a portal site instead chose to restore the site. Specify the content databases it is better to restore them on the machine first. This way you can chose any topology you like on the backup machine.

One Issue: I ran into one of my (100+) sites  did not come up on back up portal.
After troubleshooting for a while I found that the field (Id) in the  Sites Table in _SITE db and the file (SiteId) in the  Sites table in SPS_config did not match I changes the SiteId (SPS_conifg ) the site came up like a charm

 

with no comments
Filed under:
Why I moved my Blogs here?
created by pzanbaka on Sunday, September 02, 2007 6:54 PM

My buddy Jeff Gilbert insisted that I come and join you SMS Gurus and start talking about other products like MOSS and SPS.
Jeff is a loyal fan and a big contributor of this site. He also seems to think that Rod's sites are unbeatable.
So I figured I will listen to him, since the genius is rarely wrong LOL. I will be adding lots of old SharePoint, MOSS, and SQL posts to the myitforum community,

4 comment(s)
Filed under:
What do you think of www.mycodekb.com? Why mycodekb?
created by pzanbaka on Sunday, September 02, 2007 6:49 PM

I created this site back in 2004 originally to search my code. I found myself looking for previous code snippets. I was storing these snippets in text files. Then the idea came to me what I can store my code and previous lessons learned online.
As I was building the site, what if others could store their code and we can search each others. I think I am on to something… What do you think?
Visit the site http://www.mycodekb.com/

with no comments
Filed under:
SharePoint 2003 to MOSS 2007 Upgrade Migration Error: Halting upgrade... Microsoft.SharePoint.SPException: User cannot be found.
created by pzanbaka on Sunday, September 02, 2007 6:46 PM

This fixes 2 errors
Error 1) The migration upgrade error below[PortalSiteUpgradeAreaAndListingData] [12.0.1.0] [INFO]: Upgrade encountered an unexpected error.
Halting upgrade... Microsoft.SharePoint.SPException: User cannot be found. at Microsoft.SharePoint.SPUserCollection.GetByID(Int32 id) at Microsoft.SharePoint.SPSite.get_Owner() [SiteSequence] [ERROR]: User cannot be found.
Error 2) Manage Site Collection Owners User cannot be found

I've found a way to fix this but please try at your own risk and backup the database first! I think what is happening is that when SharePoint checks to see who the author (owner) of the site is, if the author doesn't exist Upgrade/migration fails.
The Owner of the site is stored in the Sites database table. The author of the site is stored in the Webs database table.

Step 1
Select * from Webs where FullUrl = ''
Here the full url is the one you are having problems with Copy the siteID it should look like this 3893DC55-756E-430C-8975-6214A531CAE1

Step 2
SELECT * FROM [FortBenn4_SITE].[dbo].[UserInfo] where tp_SiteId='3893DC59-756E-430C-8975-6214A531CAE1'
In here you get lots of records returned look for any valid user just copy the tp_ID for our example we make it 44

Step 3
The author and OwnerID bellow are the one you picked in step 2 (44) UPDATE [Sites] SET [OwnerID] = '44' WHERE [FullUrl]=’ '
Update Webs set Author='44' where FullUrl = ''
Step 4
Finally, go give ownership to the right user Go Windows SharePoint Services Manage Site Collection Owners Give the desired user ownership to the site
Let me know how it works make sure you test it on a backup environment

Content Database Migration from SharePoint 2003 to MOSS 2007
created by pzanbaka on Sunday, September 02, 2007 6:31 PM

This guide is aimed for a migrating a server farm with little customization.
I wrote it about two month ago as I was performing my migration. Enjoy...
1-Run Pre upgrade scan tool on WSS v2.0 or SPS 2003 farm
At the command prompt, perform one of the following actions, as appropriate for your situation:
If you are upgrading from SharePoint Portal Server 2003 to SharePoint Server 2007, type the following command at the command prompt
prescan.exe /c preupgradescanconfig.xml /all

If you are upgrading from Windows SharePoint Services 2.0 to Windows SharePoint Services 3.0, type the following command at the command prompt:
prescan.exe /all
Get any errors fixed in this stage before you move on.
You can check http://www.mycodekb.com/ for some of the errors I ran into and corrected.
Other useful slinks to troubleshoot your errors:
http://support.microsoft.com/kb/937291
Make sure you run this right before you perform the next steps.

2- Stand up and configure your new v 3.0 farm, Make sure all necessary services are started.

3-Create an IIS Website for each Web site in your in your v2 environment.
Increase ASP Script Timeout to 6000.modify the web.cofig file in the web application
Increase ASP।net execution Timeout
4- Copy all customization such as custom web parts and site definitions from your old farm to your all the WFE s on your new farm.

5- Set you WSS v 2 databses to Read Only.
Back up and restore, attach or copy the your content datasbes to the new server farm SQL Sever.
Before attaching datasbase in next step go and delete any triggers you may have created on the database, in my case I had created a trigger to limit versions on SPS 2003,, I really recommend cleaning here.
6-Attach the WSS v2 content database to your new Website using either SharePoint 3.0 Central Administration or
Stsadm tool see example below
stsadm -o deletecontentdb -url http://websitev3 -databaseserver DBSERVER-databasename WSS_Contentv3
stsadm -o addcontentdb -url http:// websitev3 -databaseserver DBSERVER -databasename CONTENTDBv2
This is going to take a while, go take a long break and hope for the best