Category: Backup


Running the SBS 2008 BPA, you receive a warning item that states:

The log file for the Windows SharePoint Services configuration database is larger than 1 GB in size. For information about how to reduce the size of the log file, see the Knowledge Base at http://go.microsoft.com/fwlink/?LinkId=159745.

SQL Config Log Warning in BPA

SQL Config Log Warning in BPA

If you follow the link, Microsoft explains how to make a SQL script that will trim your database. My problem was that even after trimming the database, it was still over 1Gb in size- 1.4Gb actually. Let’s solve this.

This is not a permanent solution, but rather a solution to temporarily shrink the log files. They will eventually build back up- I plan to execute this plan when ever I get the warning.

Also note that doing this process will make the database temporarily “Full Recovery” only. which means that if you use differential backup and recovery, after this process takes place you can only do a full recovery untill the log files build back up over transactions.

Perform a full server backup.

Now check the size of the database.

Log into your Microsoft##SSEE Database (Windows Internal Database).

By entering \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query as your server name. Select Windows Authentication. Click Connect.

Connect to Microsoft##SSEE

Connect to Microsoft##SSEE

You will see several databases- we will be working with the one titled Sharepoint_Config_#########.

Databases

Databases

Right click on that database and select Properties. You will see two numbers for Size and Space Available. Look at the size. Mine was 1449 Mb. I ran the Microsoft suggested SQL script, and it was still the same size. So here is what to do.

Under the options tab of the database properties, change the Recovery Model dropdown from Full to Simple. This tells SQL to truncate the log files, meaning only a full recovery is available.

Recovery Model: Simple

Recovery Model: Simple

Click Ok.

Now Run the logshrink.sql to trim the database. You can do this through a command prompt by running command:

sqlcmd -S \\.\pipe\mssql$microsoft##ssee\sql\query -E -i
 
-or-
 
You can double-click logshrink.sql. It will ask you to log in, use the same information as above. Above the window that opens, click Execute.
Execute Script

Execute Script

 

Now go back into the Properties of the config database, click Options, and change Recovery Model back to Full.

Trimmed Database

Trimmed Database

You should see your file size WAY smaller now, happy shrinking.

Advertisements

NOTE: This process DOES NOT WORK! I thought that maybe I could trick Lync 2010 to install on a DC, but the SQL failure got quite annoying, and I gave up. Instead, I will be installing both SQL 2008 and Lync 2010 on a Windows Server 2008 R2 member. I will get back to you on that configuration.

If you would like a walkthrough on how to install Lync Server 2010 on a Windows Server 2008 R2 member server, read this post here.

Do not attempt this install, it will not work.

I am going to install Lync Server 2010 on SBS 2008 SP2. This is a production server- I do not recommend doing this until you have planned and tested it first. I do not have a test server available, so it is going on a live server. The server also has Exchange 2007 SP2, and runs one Sharepoint site on WSS 3.0. Server traffic consists of Sharepoint Document Sharing, File and Print, Exchange Email, and Windows Internal Databases. We have no other applications running that use network or server bandwidth.

I am running a HP Proliant ML150 G5 Server, 8GB RAM, 2x mirrored 150GB HDD’s. This set up is VERY weak, and I am not sure as to the impact of the Lync Server- hopefully by the end of this post I will be able to inform you on what it is doing to my network. We have 18 workstations which will use the Lync Client, remote workers will not use it. We will also only be using Lyns for IM and Presence to start, no video, voice, or conferencing. My install will differ than yours if you are installing the Enterprise version, or have a need for A/V conferencing, phone system integration, or server pools. This will be a Single-Server install, or a stand-along server. It will host the Management Site as well.

Microsoft has a site with all of the information you need. I would suggest printing off and reading all of the planning and deployment guides, as well as watching the videos. The site is here.

Run the Lync Server Planning Tool, which can be downloaded here. It is pre-release at the moment.

I got the Lync Server 2010 and the Lync Client from my MAPS subscription. I will install and evaluate, and purchase licenses as we see fit. I personally do not need any license keys with the technology- how you get the disks and licenses is your problem. I burned two DVD’s- one with the server, and one with the client.

I will now run the Planning Tool, display the results, and go over some further documentation. After that, I will install Lync Server first, then one client to test. After that I will proceed to install the rest of the clients.

I am not vouching for this process, as it will consist of my troubleshooting problems that may arise during install. I do suggest you use this as a guide when you install, if you are in the same scenario- as it will be easier to understand that Microsoft’s technical documents.

run the installed Planning Tool. I usually participate in the Improvement Plan’s, if only because it stops alerts from being displayed in the SBS Console and BPA.

Lync Planning Tool

Lync Planning Tool

I selected to start from the beginning. I selected No for A/V conferencing.

I selected No for Web conferencing.

I selected No for Enterprise Voice.

I selected No for Archiving Server.

I de-selected both Federation check-boxes, as I do not use any External organizations, and I do not wish users to connect to public chats like Yahoo! or MSN.

I selected No for High Availability- I only have one server.

I left the selection alone for Shared WAN. We do not have remote sites as a part of our network, only our Local LAN will use this application.

Central Site

Central Site

I will name my site something appropriate- my companies name plus Lync. I suggest you do the same, and do not include any crazy characters, etc.

Fill in your user count. I only need 10 to start, and 18 to finish, so I will enter 20 to be safe.

For my internal SIP domains, I enter both my local domain name, and my remote domain name, which I use for RWW, OWA, and Exchange. they are company.local, and company.org.

I then select No for External User Access- this will only be used inside my office.

You will now see a topology of your setup. Thankfully, mine is REALLY simple.

Topology

Topology

Clicking on my site, then double clicking the icon, I see some requirements.

Requirements

Requirements

I don’t have enough RAM, or all the correct ports open for the software load balancing. I also do not have SSD’s, or enough NIC’s. Well, I have two, but one is disabled and not in use. These requirements are also planning for way more features than what I will be using. I will print this and proceed for now, and open ports or install services as they come up.

Keep in mind now that I am installing Lync Server 2010 on a stand alone production server with a low amount of RAM and not enough requirements met for install. Do this at your own risk. Back up frequently- a 2 hour restore is not to bad if you destroy your server.

Microsoft also recommends that you install Lync onto a child site of your AD Domain. I have such a small AD, that I will just stick it in there with the 40 users and other objects.

I have been reading Microsoft’s Guides, and a lot of their steps are for specific scenarios, and I get a hint that most of mine will be automatically configured- such as DNS SRV records for SIP domains. So I insert the DVD, and click on E:\Setup\amd64\Setup.exe

I get a pop-up about installing MS Visual C++ 2008, and click Yes.

Microsoft Visual C++ 2008

Microsoft Visual C++ 2008

You are then presented with the Lync Install screen. I changed the default path to D:, this is my application/data drive and has more space.

Lync Server Install

Lync Server Install

Click Install.

Check the box to accept the license, after reading it of course 🙂

License Agreement

License Agreement

The installer does it’s thing.

Core Components Install

Core Components Install

You then enter the Deployment Wizard screen.

Deployment Wizard

Deployment Wizard

This is taken from the help link under Prepare Active Directory.

To begin the installation of Microsoft Lync Server 2010, you must prepare the Active Directory Domain Services (AD DS) schema, forest, and domains that will host servers and users. The Lync Server Deployment Wizard will guide you through the steps required to prepare Active Directory Domain Service (AD DS), beginning with the schema and then into the forest preparation. After confirming that AD DS replication is successful, you then prepare each domain that will host users or servers.

Important:
To successfully prepare the schema, you must be logged in as a member of the Enterprise Admins group and the Schema Admins group. To prepare the forest, you must be logged in as a member of the Enterprise Admins group or logged in as the administrator in the forest root. For domain preparation, you must be logged in as a member of the Domain Admins group.

Now we click the button to prepare the AD. The next screen has a few options. Now, extending the schema is a huge deal. So, I decided to do a full server backup before I press any more buttons. And good thing- the last backup 6 hours ago failed for some reason. Ill look into those event logs later on. I will finish this backup, make sure it was successful, then proceed.

At this point, Windows Update popped up, with 14 new important updates to install. Booo. Ok, so I install those, and then reboot. My server is great, minus a few warnings that can “be safely ignored” according to Microsoft. Now I resume.

Click Prepare Schema, and Run, then click Next.

Prep AD Schema

Prep AD Schema

Once it completes, I clicked View Log. I then expanded the fields, and browsed the log. I noticed some errors in the log, though the action DID complete successfully.

Extend AD Schema Log

Extend AD Schema Log

I clicked finish, and then checked the deployment using the steps written here. As you can see from the screenshot, my schema was configured correctly.

ADSI Edit Schema

ADSI Edit Schema

I Then ran Prepare Current Forest, and left it set to Local Domain.

Universal Group Location

Universal Group Location

I wont post the screenshot of the log, because editing my personal information out of it would take ages, but you should take time to review it, and make sure everything was created and completed successfully.

You should verify this as well using the steps described here.

Now click Run under Prepare Current Domain, then next.

Prepare Domain

Prepare Domain

Once that completes, check that it was successful using the steps listed here.

Lync Management Shell

Lync Management Shell

Lastly, I will add my account to the CsAdministrators group, which will allow me access to the Management Console. Open ADUC, go to My Business, SBSUsers, and double-click your account, or the account you want to make admin.

Click the Member Of tab, and then click add. Type in CsAdministrators, and click ok.

CsAdministrators Membership

CsAdministrators Membership

I then Exited the Wizard, with everything complete.

I clicked Install Topology Builder, which is a pre req to deployment.

I re opened the Deployment Wizard, and clicked on Single Server Deployment, to the right.

Single Server Deployment

Single Server Deployment

The first screen gives me a message about SQL Server 2008. I have the default SQL 2005 Express installed. Not being comfortable with SQL Server Management, and having the knowledge that side by side installs of the same project can be tricky (And also that migrating my databases to a different SQL version can be hard), I decide to stop for the night. I will run a full backup, because right now everything is still working correctly. I will also contact Microsoft support chat and read my documentation to see the process for this step- I will get back to you in the morning.

Good morning. I did some research, and Lync Server will install SQL 2008 Express. I do not wish to migrate, so it will be a side by side install. In order for that to work, some workstation components of SQL 2005 Express need to be uninstalled.

Click Programs and Features in the Control Panel. Select SQL 2005 Express and click Change. Select Workstation Components. Uninstall everything that comes up when you get to the component screen. This is removing only the tools, not the database or database server.

SQL 2005 Workstation components Uninstall

SQL 2005 Workstation components Uninstall

Uninstall Success

Uninstall Success

Now I will pick up the Lync Server 2010 Setup via the Lync Server Deployment Wizard in the Start Menu.

Click on Prepare First Standard Edition Server. Click Next, and let the commands finish.

Single Standard Edition Setup

Single Standard Edition Setup

This step takes some time, over 20 minutes for me.

Install

Install

After some time, the setup completes, with a bright red item.

Setup Failure

Setup Failure

Checking the log, I see that SQL Backwards compatibility and Native Client are installed, but not SQL 2008 Express itself. What a pain. I think I will try to install SQL 2008 Manually through its GUI, then if needed, command line.

Navigate to C:\Program Data\Microsoft\Lync Server\4.x.xxxx\ and double-click on SQLEXPR_x64.exe.

That opens up the SQL 2008 setup. I then clicked Hardware and Software Requirements, and Configuration Checker.

SQL 2008

SQL 2008

In the tool, I received one warning and passed the rest. Fail.

SQL Install on DC Error

SQL Install on DC Error

After some reading, Microsoft states:

Installing SQL Server on a Domain Controller
For security reasons, Microsoft recommends that you do not install SQL Server 2008 R2 on a domain controller. SQL Server Setup will not block installation on a computer that is a domain controller, but the following limitations apply:

On Windows Server 2003, SQL Server services can run under a domain account or a local system account.

You cannot run SQL Server services on a domain controller under a local service account or a network service account.

After SQL Server is installed on a computer, you cannot change the computer from a domain member to a domain controller. You must uninstall SQL Server before you change the host computer to a domain controller.

After SQL Server is installed on a computer, you cannot change the computer from a domain controller to a domain member. You must uninstall SQL Server before you change the host computer to a domain member.

SQL Server failover cluster instances are not supported where cluster nodes are domain controllers.

SQL Server Setup cannot create security groups or provision SQL Server service accounts on a read-only domain controller. In this scenario, Setup will fail.

So I think I can get away with it, I just can’t use local accounts. So I will ignore this error, and click New SQL Server…..

New SQL 2008 Install

New SQL 2008 Install

On the window that appears, click install to install setup support files. It comes back with a few warnings, one for Windows Firewall. I will let you battle this one out yourself, but some information can be found here.

Click Next, and it will ask for a product key- which is greyed out. I have a full version of SQL 2008 Standard, but I wan’t to leave this Express- the less management and install I have with SQL the better, IMHO.

SQL Product Key

SQL Product Key

Click Next.

Accept the license and click next.

Select all products, leave the directory alone, and click Next.

Select All

Select All

Leave it at Named Instance, in this case SQLExpress. You can change this if you want- I do not.

Instance ID I also left alone. For the root directory, I moved it to the D:\ drive and created a new folder called D:\Program Files\SQL 2008 Root Dir\

Only to save space on my C:\ drive.

Instance Configuration

Instance Configuration

Click Next, and you should get a success message.

Success

Success

Click Next.

Now I am not going to use NT\Authority for SQL Server Database Service Account. this helps with least privileged, separation of duties, plus I do not think you can do the side by side install using NT\Authority.

So create a new user in Users ADUC, and use that account and password to set up this account.

Select that user, and enter the password, then hit Next.

Select Mixed Mode, and enter a strong unique password for sa. Add the SQL administrators using the add button on the bottom. I am the only one, so I clicked Add Current User.

SA

SA

Click Next. Check both Microsoft Reporting boxes (or not, if you wish), and click next. It should complete with 8 Passes, and no errors.

Click Next. Review your settings, and click Install when ready. It will take a while to complete. While the bar progresses, cross your fingers and hope the side by side install of SQL works, and doesn’t bork your system.

Success

Success

Everything succeeded, and you get a reboot message. Now this is a production server, and it is 11 AM on Friday. I can’t reboot, and wont continue untill I do reboot. Ill be back later tonight, when no one is in the office.

After reboot, everything is up and running just fine. No errors, SQL is automatic and started fine. Now its time to resume the Lync install. Double click the Lync Server Deployment Wizard from the Start Menu again.

Click Prepare Single Edition Server. Click Next and it will resume where we left off when it failed the first time. It failed again, this time while trying to create an instance RTC in SQL 2008. So I run this command from the command line:

“C:\ProgramData\Microsoft\Lync Server\Deployment\cache\4.0.7457.0\SQLEXPR_x64.exe” /ACTION=Install /FEATURES=SQLEngine,Tools /INSTANCENAME=RTC /TCPENABLED=1 /SQLSVCACCOUNT=”NT AUTHORITY\NetworkService” /SQLSYSADMINACCOUNTS=”Builtin\Administrators” /BROWSERSVCSTARTUPTYPE=”Automatic” /AGTSVCACCOUNT=”NT AUTHORITY\NetworkService” /SQLSVCSTARTUPTYPE=Automatic

So I check the event logs, and see that SQL Server Browser did not start, and a new instance could not be created. I go to services, and see that SQL Server Browser for SQLExpress (which is my 2008) is disabled. Enable that by right clicking the service, and selecting properties. Then change start type to automatic, and click ok.

SQL Service

SQL Service

I then realized that I did not have Management Studio Express installed, so I downloaded and installed that from here. I changed the SQL Server Agent Service log on account to the same account I set up for SQL.

Turns out that I can’t install the tools package, some sort of Digital Signature Error, which is going to be a pain. So… I wen to Add/Remove Programs, clicked on SQL 2008, clicked Change. Then added new features, blah blah blah. The information on how to do that is here, scroll to the comment at the bottom. Thanks guys.

Another reboot to continue, I am now up to three- not great fun on a production server. So I mucked around and added the SQL2008 account- the account I use to run both the Server Agent and the SQL instance- to some Administrator and SQL Admin roles, to no effect. Every time I tried to run the SQL Server Agent, I got the start stop message and an event id of  103, Service Control. I know that this is a permissions thing, so I change both of the services to Local Account, and now the services start fine- but the installation still fails.

At this point I am finally able to push the Management Console through. Instead of modifying an existing instance, which doesn’t allow you to add tools, I select new instance, then select Management Tools.

Management Tools Install

Management Tools Install

The install failed, and I am seeing messages for SQLExpress recovery, services will not start still, what the hell. I uninstall all SQL 2008 items, and start over. At this point I spend an additional 6 hours messing around with the innards of Lync and SQL 2008, only to come to the conclusion that I do not have the skill to perform this install. I uninstall everything, back to normal. I am now going to add a Windows Server 2008 R2 member to my domain, and repeat this install there. I will post that when it happens.

So running the SBS 2008 BPA, I received a low disk space error, less than 15%. Now I get these errors often, and I have moved everything I could off of the drive, including Sharepoint Content, Redirected Folders, Exchange Databases, Installed Programs such as Microsoft Office.

BPA

BPA

Man, my space IS low, 9 Gb out of 60 Gb free. Let me clean out what I can. I empty all the temp folders, delete some empty folders, some setup logs… Wow, I actually recovered 10 Mb of space. Great.

Then I thought about Windows Server Update Services- I know they keep content somewhere (If you have them set to download and store content, which I do). Drats, that is on D:\ as well. (If you need to move WSUS CONTENT, this is not your post).

What about the database files themselves? I go to C:\WSUS\SUSDB\UpdateServicesDbFiles\ and there they are. Two files:

SUSDB.mdf

SUSDB_log.ldf

*** Stop Update Services Service in Services.mmc ***

Having worked with databases before, I know it is not as simple as dragging and dropping the files. So lets work in SQL.

Goto Start>All Programs>Microsoft SQL Server 2005> and select SQL Server Manager Express.

The program opens, and gives you the Object Explorer. You need to connect to a database instance to work with the database. WSUS uses Windows Internal Database, so let’s connect to that one. You can’t log in with sa, or with Windows Auth even if you are an admin- so enter this in the server name:

\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

Leave it on Windows Auth, and hit connect. Expand Databases, and your looking at quite a few of them, mostly related to Sharepoint. The one we want is SUSDB.

First, and always, BACK IT UP. This can be done by right clicking the SUSDB and selecting Tasks>Back Up. Now you will have to choose your location, medium type, and file name yourself. For me, I picked a removable HDD (A:/) and named the backup…

Backup

Backup

SUSDB.bak

Let that execute, it might take some time (mine took roughly 7 minutes). Once you get the success message, it’s time to move this DB. Since databases have active connections, and moving the files with these connections can break the the entire internet, lets DETACH the database before moving it.

On a side note this can all be done via command line and sqlcmd. I am not comfortable with the language so I just use the GUI.

Go back to SQLMSE and right click the SUSDB again. This time click Tasks>Detach.

Detach

Detach

You get a screen with one line and some check boxes. You can change some of the boxes depending upon your needs, but for this one, we will select Drop Connections and Keep Full Text Catalog, which is selected by default. As you can see the DB has current connections (such as SUS clients).

Drop Connections

Drop Connections

This will detach the DB. Go back to Windows Explorer, and navigate to the C: drive. Grab the entire WSUS folder, and move it to your target drive. I moved mine to D:\WSUS, which is where my catalog is as well. Might want to give it it’s own directory to be safe.

Now we need to re-attach the database. Go back to SQLSME and right-click on instance, in this case, \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query (SQL Server 9.0.4035 – Domain\UserName).

Click Tasks>Attach.

Attach

Attach

Click Add, and navigate to your new database location.

Choose Location

Choose Location

Click ok. Let it work, it will gray out and take a bit.

Attaching

Attaching

Once it is complete, double-check the database file location by right-clicking SUSDB and selecting properties. Select Files on the left, and look at the Path. You should see your new database path listed there.

Path

Path

Your done. Close everything out, and double-check both the SBS Console and the WSUS Console to make sure everything is synchronized and working. That just recovered almost 4 Gb of space on my otherwise picked-clean C: drive.

*** Start Update Services Service in Services.mmc ***

I use this simple script to backup some items on my server, which I would like separated out of the standard Windows SBS 2008 Backup and WSUS 3. It is possible to do a lot with the default server backup, but what if you need just one file? Welol, it’s a pain in the butt to get that out of a full server backup. You could use NTBackup to backup the whole server, but restoring that can be difficult, as SBS 2008 doesn’t recognize NTBackup’s. You could do it with the WBADMIN command, but a lot of people don’t know how to use it. So here is the script. I will post the code, then describe what each part does. Feel free to customize it, or post improvements on it. Im also going to remove all of the echo commands that I have that let me know what each stage is doing. To add a text feedback to this script that will inform you of what’s going on, do the following:

Type Echo
I use ***TEXT*** so that it is visually explicit.


@ECHO OFF
@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe"
for /F "tokens=1-4 delims=/- " %%A in ('date/T') do set DATE=%%B%%C%%D
for /F "tokens=1-4 delims=:., " %%a in ('time/T') do set TIME=%%a%%b%%c

CHOICE /C:YN /D:N /T:3

%STSADM% -o backup -url "http://companyweb" -filename "\\solaceserver\300GB HP Backup\Companyweb Backup\Companyweb_Backup_%DATE%_%TIME%.dat" -backupmethod differential -item "farm" > "\\solaceserver\300GB HP Backup\Companyweb_Backup_log.txt"

xcopy /y "C:\windows\system32\inetsrv\config" "A:\IIS Backup\" /e > "A:\IIS_Backup_log.txt"
xcopy /y "D:\EZ Claim Data" "A:\EZ Backup\" /e > "A:\EZ_Backup_log.txt"
xcopy /y "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12" "A:\CompanywebStyle\" /e > "A:\Companyweb_Style_Backup_log.txt"

sqlcmd -S .\SBSMONITORING -i "C:\SQL Scripts\sbsmonitoringbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\admincontentbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\sharewebdbbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\spconfigbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\susdbbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\wsscontent_c76dcbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\wsscontent_cb60cbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\wsscontentbackup.sql"
sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i "C:\SQL Scripts\wsssearchbackup.sql"

IF EXIST A:\GPO_Backup RMDIR A:\GPO_Backup /s /q
IF NOT EXIST A:\GPO_Backup MD A:\GPO_Backup

FOR /f "tokens=1-3 delims=/ " %%a in ('DATE/T') do set date=%%b-%%a-%%c
FOR /F "tokens=1-5 delims=/: " %%j IN ('TIME/T') do set time=%%j-%%k

cd "C:\GPMC\SCRIPTS"
cscript BackupAllGPOs.wsf A:\GPO_Backup /Comment:"GPO backup on %DATE%_%TIME%" /Domain:solace.local

for /F "tokens=1-4 delims=/- " %%A in ('date/T') do set DATE=%%B%%C%%D
for /F "tokens=1-4 delims=:., " %%a in ('time/T') do set TIME=%%a%%b%%c

ntbackup backup "@A:\Exchange File Backup\Exchange_NTBackup_Config.bks" /a /d "Exchange Server" /v:no /r:no /rs:no /hc:off /m normal /j "Exchange Server" /l:s /f "A:\Exchange File Backup\Exchange_Backup_%DATE%_%TIME%.bkf" > "A:\Exchange_Backup_Log.txt"

:End
Code Description
@ECHO OFF This gags the code from being repeated visually on the script
@SET STSADM=”c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe” This sets the directory for STSADM. This might vary by computer depending upon your install, but the directory you see is the default.
for /F “tokens=1-4 delims=/- ” %%A in (‘date/T’) do set DATE=%%B%%C%%D for /F “tokens=1-4 delims=:., ” %%a in (‘time/T’) do set TIME=%%a%%b%%c This code and the following FOR code sets variables that allow us to put the date into a filename.
CHOICE /C:YN /D:N /T:3 This is a choice command, with a timer, /T:3 is 3 seconds. This doesn’t really do anything but pause- I add the text to it something like Press Ctrl-C to cancel backup now! Ctrl-C breaks the script.
%STSADM% -o backup -url “http://companyweb” -filename “\\solaceserver\300GB HP Backup\Companyweb Backup\Companyweb_Backup_%DATE%_%TIME%.dat” -backupmethod differential -item “farm” > “\\solaceserver\300GB HP Backup\Companyweb_Backup_log.txt” This runs the STSADM command. It is the command line version of Sharepoint Administration, and command backup without using the GUI in Central Administration. –o backup tells it to backup “http://companyweb”. –Filename tells us the location of the backup.dat. the > xxx.log.txt tells the script to output all the results of that command into a logfile. I have each command in a separate logfile to ease confusion.
xcopy /y “C:\windows\system32\inetsrv\config” “A:\IIS Backup\” /e > “A:\IIS_Backup_log.txt” Xcopy is simply a copy command. I run this on several critical directories, and make a hard backup of the files contained. /y makes the script overwrite, while the following “ are the backup target and backup end directory. /e copies subdirectories and folders.
sqlcmd -S .\SBSMONITORING -i “C:\SQL Scripts\sbsmonitoringbackup.sql” sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i “C:\SQL Scripts\admincontentbackup.sql” I run 10 of these. SQL 2005 Express does not offer native backup scheduling. But you can enter an instance, and manually set up a backup. Then you can script this to file, then you run the file from this script. How to do this is documented here.
IF EXIST A:\GPO_Backup RMDIR A:\GPO_Backup /s /q IF NOT EXIST A:\GPO_Backup MD A:\GPO_Backup This command checks for a directory. If it exists it deletes it and creates it again, empty. This keeps down the size of a directory.
cd “C:\GPMC\SCRIPTS” cscript BackupAllGPOs.wsf A:\GPO_Backup /Comment:”GPO backup on %DATE%_%TIME%” /Domain:solace.local This backups all Group Policy Objects. Download the script files from here. Change this command to match the location you install the .wsf files. Quite handy.
ntbackup backup “@A:\Exchange File Backup\Exchange_NTBackup_Config.bks” /a /d “Exchange Server” /v:no /r:no /rs:no /hc:off /m normal /j “Exchange Server” /l:s /f “A:\Exchange File Backup\Exchange_Backup_%DATE%_%TIME%.bkf” > “A:\Exchange_Backup_Log.txt” This performs an Exchange only backup. You need to create the backup with NTBackup, and save selection as. Then you reference the bks file in this script. The command descriptions are here.

If you are a Sharepoint Administrator, great. SQL Admin, awsome. If you know programming, sweet. But what about those of us that don’t know these things? What if you manage a small Sharepoint site, and don’t know the inner workings of SQL? Extracting content from a database backup after a restore can be a nightmare.

I discovered this post and I had to put it here- this tool is rediculously usefull. Pascal Gill designed a small program with GUI which can be used to extract content from a sharepoint database, and it even keeps directory structure and subfolders. I also used it to extract a custom list with metadata so that I could put it onto my new site. Thanks Pascal!

Sharepoint Exporter

Sharepoint Exporter

The site is here.

The tool is here.

If you have any questions about what to fill in for the database name and server fields, please post here or on Pascal’s blog.
This tool is not my creation, and I can not assure you of the files contents. I can however vouch for the validity of the program and code, as I have used it many times.

%d bloggers like this: