Backup and Restore of the Companyweb Website aka Windows SharePoint Services 2.0


[Today's post comes to us courtesy Bhushan Gokhale]

Very often, we need to backup or restore the Companyweb website. Doing so involves the use of complicated SQL commands and SQL operations that leave us stumped. The process of backing up the Companyweb website is pretty much the same for all Companyweb setups. However, there are different procedures for restoring the databases depending on the condition in which the restore is being carried out.

Let’s try and see how and when to use different methods to backup or restore Companyweb databases under different circumstances.

Backing up the Companyweb databases using the stsadm command:

To backup the Companyweb databases, we use the stsadm command from the command prompt. The syntax to backup the database is:

Stsadm –o backup –url http://companyweb –filename c:\backup.dat

The path for the filename can be changed, of course.

This command can be used to backup the Companyweb website as it is at the time the command is run. As the command shows, the backup of the database is a “.dat” file that we can use to restore the website. Once we have backed up the Companyweb website, we can use the stsadm command to restore it. Such a backup is extremely helpful if you have accidently deleted content that should not have been deleted. However, it is recommended that you use the stsadm command to restore the Companyweb website, on the same server on which the backup was taken.

Restoring the Companyweb databases using the stsadm command:

To restore the Companyweb database using the stsadm command, on the command prompt, run the command below:

Stsadm –o restore –url http://companyweb –fliename c:\backup.dat –overwrite

Note: More information regarding the backup and restore of the Companyweb databases is available on:

http://support.microsoft.com/kb/829112/en-gb

http://support.microsoft.com/kb/833797/en-gb

Note: If you are using stsadm to restore Companyweb databases to a different server where the server name and the domain name are different, you may have to recreate all the user accounts for the Companyweb website using the SharePoint Central Administration website. You will also have to modify all links to the old server to resources on the new server. To recreate user accounts for the Companyweb website, follow the instructions on:

http://support.microsoft.com/kb/827701/en-gb

Restoring Companyweb after removing and reinstalling the intranet component:

Information on restoring the Companyweb website after removing and reinstalling the intranet component is available on:

http://support.microsoft.com/kb/829113/en-gb

This method can be used if you have never backed up the Companyweb databases using the stsadm command. However, for the restore to complete, you would need a backup of the Companyweb database files:

1. STS_Config.mdf

2. STS_Config_log.ldf

3. STS_<server name>_1.mdf

4. STS_<server name>_1_log.ldf

It is, however, important to keep the following points in mind when using the information on this article:

· The Microsoft Active Directory service domain database has not changed since the last time that a backup copy of the Windows SharePoint Services 2.0 data files was created.

· If the server was rebuilt, The System State of the original server has been successfully restored from the backup copy.

· The Windows Small Business Server 2003 intranet component has been installed.

· The Companyweb intranet site (http://Companyweb) is accessible.

Restoring Companyweb after the server is rebuilt from scratch using the same domain name:

The knowledge base article we discussed in the section above cannot be used if the server has been rebuilt from scratch. In this case, you would need to recreate the user accounts for the Companyweb website using the SharePoint Central Administration website even if the domain name and the server name are the same as before the rebuild.

The article below provides a step by step approach on how to restore Companyweb if the server has been rebuilt from scratch:

http://support.microsoft.com/kb/827701/en-gb

Again, before using this article, consider the following information:

· You must ensure that the domain name for the new server is same as that of the original server.

· Microsoft Small Business Server 2003 with the intranet component is installed.

· The Companyweb Web site must be working with a new, unmodified database.

· The Companyweb intranet site (http://companyweb) is accessible.

What if 829113 or 827701 don’t work?

After running through the above articles, based on your requirement, if you are still unable to access the Companyweb website, use the troubleshooting steps discussed below:

Check to make sure that the content and configuration databases are attached. You can use the Microsoft SQL Server Management Studio Express to do this. It can be downloaded from:

http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

1. Once the Microsoft SQL Server Management Studio Express is installed, launch it, and, from the “Connect to Server” window, connect to your SharePoint instance of SQL.

<Server Name\SHAREPOINT>

2. Expand the database instance, and confirm that the following databases are present:

STS_Config

STS_<Server Name>_1

If you don’t see these under the database instance, they are not attached correctly. To attach the databases:

3. Right click the database, and select the option to “Attach”.

4. Click on Add.

5. Browse to the location:

C:\Program Files\Microsoft SQL Server\MSSQL$SHAREPOINT\Data

Note: This is the default location of the SharePoint databases. If you moved the databases to a different location during the install, browse to the appropriate location.

6. Select the database you want to attach; STS_Config.mdf or STS_<Server Name>_1.mdf.

7. Click on OK twice, and you should see the database attached under the SQL instance.

8. Once the databases are attached, check their properties to make sure you can access the databases.

Common errors during the restore of the Companyweb website:

1. When you try to restore Companyweb using stsadm, you get the following error:

“Your backup is from a different version of Windows SharePoint Services and cannot be restored on the server running the current version”

Resolution: Make sure that you are at the same service pack and hotfix level as the original server where you backed up the Companyweb using stsadm command.

2. When you try to add the old content databases from “Manage content Databases” page in SharePoint Central Administration, you get the error:

“The database schema is too old to perform this operation in this SharePoint cluster. Please upgrade the database and try again”

Resolution: Make sure you are at the same service pack and hotfix level as the original server.

3. In some cases you may get one of the following error messages when you are trying to attach the databases or when you are trying to access the properties of the databases using SQL Server Management Studio Express:

The database STS_<Servername>_1 is not accessible (Microsoft.SQLSErver.Express.ObjectExplorer)

image

Or

The database STS_Config is not accessible (Microsoft.SQLSErver.Express.ObjectExplorer)

Or

You get the following error when you try to attach a database:

image

Resolution: To fix this issue, make sure that you are at the same service pack and hotfix level as the original server and your SQL Server install is at the service pack level as the original server.

If you still cannot attach the database, it was probably upgraded to one of the following levels:

a. SQL 2000 Full Version

b. SQL 2005 Express Edition

c. SQL 2005 Full Version

If you are running the premium version of SBS 2003, install the appropriate version of SQL. While installing SQL you can upgrade the current SharePoint instance. Make sure that you have backed up the database files before upgrading the instance to the Full Version of SQL.

If you already have SQL installed on the server and you are not using it for any other application, you can try to attach the databases to the default instance of SQL. To do this, use the procedure outlined below:

1. Open Microsoft SQL Server Management Studio Express.

2. From the “Connect to Server” window, connect to the default instance. This would be the <Server Name> instance, and not the <Server Name>\SHAREPOINT instance.

3. Right click the database instance, and select the option to “Attach”.

4. Click on Add.

5. Browse to the location:

C:\Program Files\Microsoft SQL Server\MSSQL$SHAREPOINT\Data

Note: This is the default location of the SharePoint databases. If you moved the databases to a different location during the install, browse to the appropriate location.

6. Select the database you want to attach; STS_Config.mdf or STS_<Server Name>_1.mdf.

7. Click on OK twice, and you should see the databases attached.

How to configure WSS 2.0 to use Default Instance of SQL:

1. Make sure you have added “NT Authority\Network Service” and “Domain Name\SBS SP Admins” under the logins option for the database.

To check this, follow the steps below:

a. Connect to the default instance of SQL.

b. Expand Security and Logins.

c. You should see the two accounts listed here.

d. If you don’t see them, right click on Logins, and select “New Login”.

e. Under the login name, type in “NT AUTHORITY\NETWORK SERVICE” and click on OK.

f. Repeat the same procedure for the “Domain Name\SBS SP Admins” account.

2. Make sure that “NT AUTHORITY\NETWORK SERVICE” and “Domain Name\SBS SP Admins” are ‘dbowner’ for STS_CONFIG and STS_<Server Name>_1 databases.

To check this, follow the steps below:

a. Double click on NT AUTHORITY\NETWORK SERVICE.

b. Select “User Mappings”.

c. Make sure that STS_Config and STS_<Server Name>_1 are selected.

d. Highlight each database, and make sure that dbowner is checked.

e. Repeat the same procedure for “Domain Name\SBS SP Admins”.

3. Set the configuration database.

To do this, follow the steps below:

a. Open SharePoint Central Administration.

b. Click on “Set Configuration Database Server”.

c. Under database server, you should have <Server Name>\SHAREPOINT.

d. Change it to <Server Name>.

e. Select “Connect to Existing Configuration Database”, and click on OK.

f. You may get the following error:

Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’ (Error code: 18456).

g. To resolve this error, make sure the “NT AUTHORITY\NETWORK SERVICE” is listed under logins.

h. Try to set the database server again using the steps above. It should work if the account is correctly listed under logins.

i. Go back to the home page for the SharePoint Central Administration website.

4. Set the content database.

To do this, follow the steps below:

a. Select the option to “Configure Virtual Server Settings”.

b. Select the Companyweb website on the next page.

c. Select the option to “Manage Content Database”.

d. Select the content Databases, and remove them on the next page.

e. Click on “Add a Content Database”.

f. Select “Specify Database Server Settings”.

g. Change the database server from <Server Name>\SHAREPOINT to <Server Name>.

h. Under database name, type the content database you want to add, e.g. STS_<Server Name>_1.

i. Type 9000 and 15000 in the boxes below, and click on OK.

j. You should have the content databases attached successfully.

In most cases, running through these procedures, based on the condition where the restore is being done have helped getting the Companyweb website up and running. In case you have any doubts or queries, or if you have any feedback on the content of this article, please let us know, so we can address your questions in a quick and efficient way.

Skip to main content