SAMS came up with a great SharePoint backup automation tool with their SPSiteBackup.wsf windows script file - it is good, but needed a couple things... so I added them...
The SAMS backup utility is really pretty great. It runs backups on all of your site collections on a given site as well as as logging the results and emailing the logs to users. This is very useful, but it is lacking a few features that I felt it needed.
First of all, the backup utility put all of the backup files into one directory. When you have a lot of sites, not to mention if you are backing up MySites, this can become a massive chunk of data. If you are running this script on any recurring basis, it just turns into a non-decipherable mess of hundreds and hundreds of files, no organization whatosever. I made a change here that will automatically make folders (named by date) and place the backups in the properly dated folder.
Second, there is no garbage collection. If I ran the script every day, I would eventually choke out all of my storage and be stuck with 100s of GBs of backups. I could just go in and delete them manually, but no one wants to do that (so 90s). What if I forget, or go on vacation, or leave - so, I made a garbage collection method run within the script as well.
All you need to do is place the script file directly on your C: drive, customize the batch file (explanation provided within the .bat file) and schedule it to run (or run it manually) and you are running maintenance-free automatic backups on your SharePoint server/farm.
Ok, if you feel ok on your own now, stop reading - if not, read on for a step-by-step tutorial on how to schedule the automated backups on your server...
Get the backup script files ready
- Copy the 2 files from the .zip file to the machine you want to run backups on directly to the C: drive
- Open spBackup.bat in a text editor, you will see the following:
- Change the input variables to what you need them to be (self-explanatory) for that server instance.
Now that is set up, you need to schedule the job.
- Click Start->Programs->Accessories->System Tools->Scheduled Tasks
- Double-click Add Scheduled Task, choose Next
- Click Browse... and browse to the .bat file you just edited (C:/spBackup.bat)
- Name the task and choose how often to perform the task click Next
- Choose the start time click Next
- Enter your password click Next
- Click Finish
It's just that easy, you are now making and cleaning up backups automatically. Here it is one more time:
Automated_SP_Backup.zip (3.60 kb)
"Your backup is from a different version of Windows Sharepoint Services and cannot be restored to a server running the current version."
DAMN YOU SHAREPOINT! NO IT ISN'T!!!
That was the error I have been facing for a couple of days and it was driving me utterly crazy.
This was my situation: I was tasked with migrating the sharepoint data on an ancient server (PIII 512 RAM) running WSS 2.0 and SQL 2000 to a new server running MOSS 2007 and SQL 2005 - I have done plenty of backups and restores on SharePoint, and they are suprisingly easy. This should be no problem...
Wrong. This turned into a classic battle of me vs. some software, and I refused to let it win! (plus, my boss would be pissed).
You can read the [Details of the battle] or just read on for the solution.
Try #1: Simply backup the WSS 2.0 instance with stsadm.exe, and restore it on MOSS with the same tool;
RESULT: Failure - SharePoint doesn't like that, probably version issues (keep in mind this backup takes 12 hours to run on that dinosaur machine).
Try #2: Back up the WSS 2.0 instance with stsadm.exe using the catastrophic backup/restore;
RESULT: Failure - stsadm.exe did not support catastrophic backup/restore until WSS 3.0.
Try #3: Back up and restore using smigrate.exe;
RESULT: Failure - smigrate was deprecated and is no longer used in MOSS 2007, argh! (another 12 hour backup)
Try #4: Upgrade WSS 2.0 to WSS 3.0 to try and resolve version issues;
RESULT: Failure - the mighty PIII with 512 MB RAM is just too weak for 3.0.
Try #5: Downgrade new machine to WSS 2.0, and attempt restore with stsadm.exe;
RESULT: Failure - "Your backup is from a different version of Windows Sharepoint Services and cannot be restored to a server running the current version."
Try #6: Patch both machines to the same exact version of WSS 2.0, re-run backup (12 more hours) and restore;
RESULT: Failure - "Your backup is from a different version of Windows Sharepoint Services and cannot be restored to a server running the current version." F YOU SHAREPOINT, NO IT ISN'T!
Try #7: Maybe its the databases being different... even though it is said to be compatible, so I will upgrade the old machine to SQL 2005;
RESULT: Failure - The upgrade Wizard goes wild with errors when I even hint to the mighty PIII that I want to upgrade.
Try #8: I am scraping the internet mindlessly now for any options... Upgrade new machine to WSS 2.0 SP3 and restore.
Turns out that even though WSS Backup/Restore was supposed to be compatible with SQL 2005, they didn't actually make it compatible until SP3. So, despite not even being the same version anymore, it seemed to work just fine EVEN THOUGH THE ERROR CLEARLY STATED THAT MY VERSIONS WERE DIFFERENT! I think they need to revise that error message before someone stabs their eyes out!
So it turns out that all you have to do is this:
- Update both servers to WSS 2.0 SP3
- Backup your initial server using stsadm
- Restore to your new machine using stsadm
- Upgrade your new system to MOSS 2007
That's it... thats the whole answer to my week long battle with WSS. Now I just have to upgrade to MOSS 2007. You can get SP3 here: WSSSP3-KB923643-FullFile-ENU.zip (6.19 mb) - hopefully this saves someone a whole bunch of hours on a ridiculous problem, though no one even uses WSS 2.0 anymore...