Thursday, July 9, 2009

SpooblCloog

SharePoint Out of the box Limitaion Cloog

A thing on a thing on a thing

This is a term I just invented to refer to things we have to do to get around the limitations of sharepoitn out of the box
example:::

In the marketing subsite I have a document library - and I want to be able to classify something as either product related or service related.What I have tried:I started with 3 columns1. a "product or service" choice column (that has 2 choices prod or svc)2. a "Products" choice column (with all the products listed as choices) to classify which "product" the marketing document relates to.3. Ditto for the "Services" column

I was able to get things working pretty well with this scenario - but it is not very "pretty" - and puts too much responsibilty on the users to enter the right thing.

Improvements I'd like to make:
1. A separate list for the products - the doc lib needs to look up the product from another list that has additional info about the products (preferrably at the site collection level - so that list can be used for lookups on other sites as well)
2. ditto for the list of services
3. make the "product or a service" column a calclated one
4. Perhaps have prods and services in the same list? - although they have different attributes - so 2 lists is probably okay

What I am having issues with:
1. I got the calculated column to work - using this formula

=IF(Producx<>"",IF(Servicez<>"","Both","P"),IF(Servicez<>"","S","n/a"))

works like a charm

BUT you'll notice the funky names of my fields - thats because those are faux fields - with the products hard coded into the choice list

when I try to use my fields that are REAL lookup fields to the Products LIST - I can't refer to that field!

2. I am going to try creating a formula in SPD and see if that works -BUT I am struggling with a "server returned a non-specific error" issue (anybody have tips on how to troubleshoot that?) I will post about how that works out - later...

Tuesday, March 31, 2009

PDF compatability with SharePoint

Since Msft and Adobe don't choose to play nice together - we get to jump through hoops to make it so they can - at least when they are at a playdate at our house.

First you need to make the little icon next to items show the pdf icon - when they are pdf's

1. First you need to find a 16x16 pdf icon and put it in this folder:
-- c:\program files\common files\microsoft shared\web server extensions\60\template\images
(check the acl permission on the image - it may show for admins - and not less proveleged users)
2. Then you need to edit the xml file that stores all the refernces to icons to include a refernce for the pdf icon - here is the file
--c:\program files\common files\microsoft shared\web server extensions\60\template\xml\docicon.xml
AND here is what to add to it (at the bottom of the file, above the closing tag)
--
(note that XML is case sensitive so make sure you use same case as previous entries).

Here is a guy who even made a little bat file to do it
http://msmvps.com/blogs/cgross/archive/2004/10/26/16679.aspx - his profile pic looks like he learned how to play nice ;). Here is how the script reads - if you are curious (or in case his blog goes away)
@echo offECHO Adobe Acrobat PDF icon installation script for Windows Sharepoint Serivces document libraries by Chad Gross.
copy pdf16.gif "c:\program files\common files\microsoft shared\web server extensions\60\template\images\pdf16.gif" /y
rename "c:\program files\common files\microsoft shared\web server extensions\60\template\xml\docicon.xml" docicon.old
copy docicon.xml "c:\program files\common files\microsoft shared\web server extensions\60\template\xml\docicon.xml" /yiisreset

Then you need to install the ifilter

download it: on the Adobe web site here.
install it: (put the exe in the server - unblock it and run it- do an iisreset)
directions here: http://support.microsoft.com/default.aspx/kb/555209
if you have the wss search - there are extra hoops
http://bloggingabout.net/blogs/harold/archive/2008/10/02/index-pdf-documents-on-sharepoint-using-adobe-pdf-ifilter-9.aspx

I did not need to do more than what was mentioned in the microsoft article. It did take a few mins to start working after reindexing however-- I suggest that you be patient. (If that doesn't work - try a reboot?)

Thursday, March 26, 2009

SharePoint Toolkit released

Just found out about this newly released toolkit (well maybe not all THAT new - feb4)

· Microsoft SharePoint Administration Toolkit v3.0 x86
· Microsoft SharePoint Administration Toolkit v3.0 x64

haven't tried it yet - I'll post more info when I have it

Tuesday, March 24, 2009

Create Site in New DB aka createsiteinnewdb

It almost seems like MSFT REALLY doesn't want us to create our site collections in their own databases.

First - when you are in the UI from central admin and you go to create a new site collection, it gives you NO option to specify your db name - and worse yet it just decides for you whether to just go ahead and pile this site collection on in with the database that's there or randomly create a new one.
Read this article for more detail:
http://www.networkworld.com/community/node/19780

There is a command in stsadm that makes it so you can have some nice control over the way your pile of db's ends up looking - and what site content is in which db (call me crazy but I would sort of like to know which db is storing which site's content - an not rely on some random mechanism to just decide for me- based on the size of things at the time I created the site).

ANYWAY...
So I HAD this great script which was actually VERY simple (despite the fact htat it took me days to troubleshoot because of the whole managed paths discussion)

I finally figured out how to get it to work, by having an excluded path to "hang my site collections off of" and I won't bore you with the details of that script - SINCE IT NO LONGER WORKS! The rub is that since you can no longer exclude paths using stsadm you have to trick sharepoint into allowing you to create a sitecollection in an explicit inclusion . This article helps explain why... http://pointedman.com/post/Managed-Paths-and-SharePoint-2007.aspx

My method:

1. USE THE CA GUI to
REMOVE THE ROOT PATH (this breaks the portal - so do this off hours - but don't worry we put it back in a minute)

2. USE THE CA GUI to
CREATE AN EXPLICIT INCLUSION FOR THE NEW SITE'S URL

3. USE THE COMMAND LINE STSADM UTIL to
Create the new site collection

:: Simple (creates a db called wss_content - and prompts you to pick a template and assign users when you open the site the first time)

stsadm -o createsiteinnewdb -url http://sit-portal/newsite2 -owneremail spadmin@acme.com -ownerlogin sea-spdev\dude

:: More complex (sets the db name and the template. NOTE: this creates the db - even if it fails so if you want to run it again you will have to delete the db manually)

stsadm -o createsiteinnewdb -url http://sit-portal/newsite2 -owneremail spadmin@acme.com -ownerlogin sea-spdev\dude -sitetemplate spsportal -databasename siteinnewdb2

:: Most Complex( sets all the parameters when it creates the site. Note: this is pseudocode)

stsadm -o createsiteinnewdb -url [PORTAL_URL] + [DEPT_DIRECTORY_SITE] + / + [DEPT_URL_NAME] -owneremail sp.adminatblah.com -ownerlogin na\SPAdmin -sitetemplate [CUSTOM_TEMPLATE] -title " + [Title] + " -databaseserver [DATABASE_SERVER_NAME] -databasename [DATABASE_NAME]

4. IMPORTANT - USE THE CA GUI to
ADD THE ROOT PATH back in!

Final note - if you need to MOVE stuff out of content db's after the fact read this...
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=53

Tuesday, March 17, 2009

Part 2 - Restore Prod to Test (backup and restore)

If you are completely new to backup and restore you might want to review my rant here: http://paisleypoint.blogspot.com/2009/03/back-up-and-restore-repeatable-process.html

Part 2 - Restore Prod to Test – for data population Assumptions – there is an existing instance of a test server – that will get the prod content db written over it. Ensure you have the same updates and services packs as on the test server as were installed on the prod server. (Make sure you run the configuration updates after the service packs)
Preparation
If you have a website for the portal – use the central admin web ui to delete it – and any databases associated with it

1. Create a new web application
Central Admin -> Application Management -> Create or Extend Web Application -> Create a new Web Application DON’T forget the Host Header
Host header: Lab-Portal
Pool ID: spdev\!spFarmAcct
1.1 When you get to the database name, put in a temporary name such as WSS_Portal_DeleteMe. You will delete this database later.

2. Restore your prod content database (leave the existing shared services database). Don’t worry about the search database. You will have to recrawl your website anyway. --MAKE SURE THE DATABASE NAMES ARE EXACTLY THE SAME AS THEY WERE ORIGINALLY

If you get an error like so: SPException: Cannot attach database to Web application, you can use the Central Administration ui (or if you enjoy torture use the command line tool) to attach the database manually to the proper Web Application.

3. Next step is to remove the temp database from each web application and attach the real database you restored in step 2 --To do this Go to Central Administration -> Application Management -> Content Databases
3.1 Remove the temp db - Select the web application you would like to change. Select the database name (for example WSS_Portal_DeleteMe). Check the box in the next screen to remove content database. You should now see no database attached to the web application (it also remove it off the sql server).

4 Connect to the restored db - Select add a content database. For the database name put the name in EXACTLY as you restored it which should be EXACTLY like it originally was.

5. Don’t worry about the Search Server field since you have not started that service yet.
6. Start required services on new server. Go to Central Administration -> Operations -> Services on Server. Start the Windows SharePoint and Office SharePoint searches. Let it create a new database.
7. Recreate the SSP -Central Admin -> App Management -> Manage this farm's shared services (Click in the Shared Services link on the left!).
8. Select Create SSP – You can use the same name before SharedServices1 or change it. I would leave it so it matches the DB name) Make sure you select your SSPadmin and MySite web applications your created earlier and your restored database names. Do I have to mention again to make sure the names are exact!
9. Select the index server (it is now available since you started the service). You will get a warning stating you are changing the association of the existing web applications. Click OK.
10. Install Branding customizations
11. Open your SSP website and start a full crawl and user import. You should notice that all your SSP settings are still there.
12. Since you did not restore the Sharepoint_AdminContent database you will have recreate things like smtp server names. These are all easy things that can be found off the main Central Admin Page. You should even go through the steps they list and complete each one.You should now have a fully functioning SharePoint site on a new server with a new sql server.

Back up and restore -Repeatable Process

Note this is a rant - it has some good background info for those who are pretty green at Sharepoint Admin -BUT if you know already know your way around an stsadm script - or the central admin UI you can skip to the actual steps in the Step by Step instructions

OBVIOUSLY we know that it's not a good idea to do development on a production sharepoint server- but the sharepoint platform makes it a bit tricky to avoid the temptation, since it seems that is what the tool was intended to be used for, and since you never quite have the same stuff on dev that you have in prod, you just might succumb to such tempations. Here are MY reasons why you should NEVER do it...

After deploying a solution-you will need to do an IISReset -- be prepared to get a scathing email (with your boss cc'd) from that unix admin type who hates sharepoint becuase he JUST happened to hit the site during that 5 second period. Worse yet - what if you screwed something up? - Be prepared to get an email from everybody in the company saying - "I can't get to my documents - sharepoint is down" (as if you didn't already know you screwed yourself)

SO - that said, I set out to follow Joel's recommendations on WHAT to do from the following article: http://blogs.msdn.com/joelo/archive/2008/01/15/pilots-proof-of-concepts-test-and-pre-production-environments.aspx Where Joel says "Although you may not find many references to dev, test, staging, environments (in sharepoint development), these are critical to large deployments..." I couldn't agree more --HOWEVER I had to piece together my own version of HOW to do it. Here is what I came up with - complete with some of the sharepoint hate I experienced along the way - maybe I can shield some others of you from some of that pain...

On the Official Microsoft Technet site, there are some failry helpful instructions here:
http://technet.microsoft.com/en-us/library/cc262946.aspx
These are aimed at people actually doing recovery of content howvere - after something got lost (probably becuase they were doing dev on production). This is not exactly what I was after so I had to do some extrapolation to get it to serve my purposes...

Basically there were 2 very basic steps I wanted to follow:
1. backup the prod server
2. restore the prod server to a dev site

Couldn't be simpler right?
1. backup the prod server (BUT WHAT?)
If you look into sql server you will see several db's
--the config db (whichs stores all the enviroment specific stuff. So you DON'T want to copy that over because that is what you are trying to change)
-- the content db for The central admin (the the one with the long guid in it which you don't need - central admin is central admin)
-- the content db for the ssp(s) (I don't have alot configured in my ssp yet so I didn't need that especially since the dev server I am restoring to is on a different domain - I wanted to keep the configurations in my dev enviro and the dev user store)
-- The content db for the site collection(s) - That is the content I was after the actual data in the portal.

If you need help seeing what you have, go the the Central Admin -> Operations -> Perform a backup (under "Backup and Restore) this gives a nice visual of what there is to backup. From the first screen - you can look at it without actually doing any backing up yet.

So the three ways to do this are:
::backup the content db in the sqlmanagment studio (which is fine if you are a dba type - but "not so much" for me)
::backup using the stsadm command line tool (fine if you are a command line type -even better if you are trying to create a script to automate this - but again - not so much for me)
::backup using the Central Admin Web UI -(this is a great way if you want to walk through the steps as they are happening-unfortunatley the Central Admin UI makes it damn near impossible to do this without pulling you hair out for a week because as we know when you get errors, Sharepoint will send you on a wild goose chase tring to decipher what is going on (wrong) in the background, burrying any actual useful information in log files or behind the custom error - stack trace curtain. Here are some tips for better deciphearge -- http://furuknap.blogspot.com/2008/11/debugging-tips-for-sharepoint.html

Oh you thought that was it? No thats just the backup part - the restore part is equally fun
2. restore the prod server to a dev site
Once you have your precious backup files - then you will need to restore them and get sharepoint to make the adjustments to read the content from your dev server's point of view. Just wave the magic wand! Or if that doesn't work, try the following...

Again the three ways to do this are:
::restore the content db in the sqlmanagment studio
::restore using the stsadm command line tool
::restore using the Central Admin UI (guess which one I like?)

This post should probably be officially labeled a "RANT" so I decided to put the actual steps into a separate "step by step" post for use when actually performing the steps

Step by Step instructions

Tuesday, March 3, 2009

References for Backup and Restore

Man did this give me fits!
Until I have time to write out what I came up with
here are the articles I am referencing:

yea - this is what I want to do...
http://blogs.msdn.com/joelo/archive/2008/01/15/pilots-proof-of-concepts-test-and-pre-production-environments.aspx

but how????

I tried the command line - got errors:
backup
http://technet.microsoft.com/en-us/library/cc263441.aspx
restore
http://technet.microsoft.com/en-us/library/cc671617.aspx
How to Recover a Windows SharePoint Services Farm
http://technet.microsoft.com/en-us/library/bb795596.aspx
Back up a farm by using built-in tools (Office SharePoint Server 2007)
http://technet.microsoft.com/en-us/library/cc263298.aspx
Move content databases between instances of SQL Server (Windows SharePoint Services 3.0)
http://technet.microsoft.com/en-us/library/cc288554.aspx

I tried to use the backup and restore utils in sharepoint central admin
-got access denied errors
http://technet.microsoft.com/en-us/library/cc262946.aspx
http://www.windows-tech.info/15/b0dffeee963e602d.php



this is a good comprehensive one - but I did not like having to re run the config wizard
http://lkar.blogspot.com/2008/05/moving-moss-project-server-2007.html

this one is even better - step by step (simple) NOTE THE PART ABOUT NOT CHANGING THE DB NAME??? not sure if that is true
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_23185385.html#a21129547

this is a good one
http://office12.blogspot.com/2007/05/when-sharepoint-2007-restore-fails.html

at the end I was getting an error while restoring (after the restore - but during the attch to the website)-http://www.sharepoint-girl.com/2007/12/error-on-restoring-wsscontent-database.html

restore MOSS 2007 problem: IIS Web Site already in use by Sharepoint
http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/6f75daf7-1b84-43ed-a98c-280d5afc35b4/

others
http://www.eggheadcafe.com/software/aspnet/33771569/backup-and-restore-from-t.aspx

this one is backwards
http://blogs.msdn.com/priyo/archive/2008/01/14/move-moss-2007-from-test-to-production.aspx


this guy had fits too
http://wss.made4the.net/archive/2008/05/26/solution-development-in-sharepoint-2007.aspx

cool deployment tool - on codeplex
http://www.codeplex.com/SPDeploymentWizard