Portal creation failed Microsoft.SharePoint.SPException: The database schema is too old to perform this operation in this SharePoint cluster. Please upgrade the database and try again. ---> System.Runtime.InteropServices.COMException (0x81070571): The database schema is too old to perform this operation in this SharePoint cluster. Please upgrade the database and try again.Restoring a Database Using MS SQL Server You can use MS Enterprise Manger for SQL Server 2000 or MS SQL Server Management Studio to restore the 3 .SPB files. 1. Restore .SPB files (they are really just standard MS SQL backup files) into the database of your choice. NOTE: The configuration database can and should be recreated when moving to a new machine and thus does not need to be backed manually (SharePoint Portal Server Data Backup and Restore doesn't back it up either) and does not need to be restored either. 2. Go to the SharePoint Central Administration web page and choose "Create a portal site" under the "Portal Site and Virtual Server Configuration" section. 3. Click the Restore radio button, and fill in the names of the databases you restored. 4. If this is a new server that you restored to, you will need to modify some of the data in the database. This of course is not support by Microsoft. I have not had any issues doing this, but I cannot be held responsible if it does cause any errors as any database changes to SharePoint is not supported by Microsoft (or me for that matter). 5. At this point, the SharePoint portal should come up without errors. You should be able to create a new Windows SharePoint Services site without errors. If you have Site Definitions, themes, etc defined specifically for your purposes, you will most likely need to install and configure them before existing WSS sites will come up without error. 6. If you are using SharePoint Portal Server to keep a listing of your sites through its Sites page, you will need to update each reference to the since they are stored in the database and still point to the old server. You can always type them in the browser directly, but it is probably best to correct this to avoid accidentally hitting the production or old server. If you have a few sites, you can change this by hand, if you have a lot of sites I recommend a SQL update statement. The easiest way I have found to do this is to do a global search in replace in all three databases (not config, just Profile, Services, Site). I use something like SearchAndReplaceAllTAbles 'http://sharepoint.myco.com:80', 'http://sharepointnew.myco.com:8080' SearchAndReplaceAllTAbles 'http://sharepoint.myco.com', 'http://sharepointnew.myco.com:8080' SearchAndReplaceAllTAbles 'http://sharepoint', 'http://sharepointnew.myco.com:8080'
Thursday, August 30, 2007
Wednesday, August 29, 2007
Here is an easy way to shrink the log file of the a MS SQL 2000 or 2005 database.
The simplest way seems to be to use Enterprise Manager if your using SQL 2000 or SQL Server Management Studio if your using SQL 2005 to use the UI. The quickest is probably to copy and paste the SQL though. You can decide.
Using the UI
SQL Server Studio Management
1. Change Recovery Mode to Simple by getting properties on Database Options. Then choose Simple for Recovery model.
2. It can be found by right clicking on the database and choosing tasks. Choose Shrink and then Files. Be sure to select the File type as 'Log'
3. Change Recovery Mode to Full by getting properties on Database Options. Then choose Full for Recovery model.
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE MyDatabase
SET RECOVERY SIMPLE;
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE ('MyDatabase_Log', 1);
-- Reset the database recovery model.
ALTER DATABASE MyDatabase
SET RECOVERY FULL;
NOTE: MyDatabase_Log is by default correct. However, if a database has been renamed by default the Logical file names don't get updated. So, likely if the MyDatabase was renamed to MyDatabaseOld the Logical file name (the first parameter to DBCC SHRINKFILE) would still be MyDatabase. The name can be verified usign MS SQL Server Management Studio for SQL 2005 or Enterprise Manager for SQL 2000.
NOTE: This script can be executed from MS SQL Server Management Studio even if the database is on a SQL 2000 instance.
NOTE: If the Logical File name has an & in it you will need to put single quotes around the value as noted above. Otherwise, the single quotes are optional.
NOTE: If the log file doesn’t shrink, you may need to put the database in single user mode (under Properties | Options). Then run the DBCC SHRINKFILE command.
If all else fails and you get desperate, you can detach your database (you may need to put it in single user mode first especially if you are out of disk space), then manually go to the file system and manually delete the log file. Then attach the database again; a new log file will be created.
WARNING: With any of this, you will lose the log of transactions since you have deleted the transaction log.
You may also want to check out my entry on how to truncate the transaction log if the above isn’t working for you.