Home > Sharepoint > Migrating Sharepoint Sites Using Stsadm.exe

Migrating Sharepoint Sites Using Stsadm.exe

My experience with Stsadm.exe is migrating Sharepoint 3.0 sites from one server to another. We were using Sharepoint 3.0 on a test server and we setup Sharepoint 3.0 and MOSS 2007 on another server. We needed to migrate existing data onto the new server.

**Very important. You need to be a farm administrator on both servers to have the specific permissions to complete the migration. If you are unsure do the migration while logged into the Administrator account. In my case i thought i had the right permissions but i didn’t. Stsadm.exe didn’t prompt why it couldn’t complete the migration, it just failed.

STSADM.EXE is already on your server located here:

%PROGRAMFILES%\common files\microsoft shared\web server extensions\12\bin.

  1. Login to the server that had the files that you need to copy
  2. Create a directory on your hard drive named “spbackup” on a drive that has enough storage space for the backup files.
  3. Go to the startmenu, clicking RUN, then type in CMD.
  4. In the command prompt window opens type “cd \” to bring you to the root of C:
  5. Type in the following “cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN”
  6. This next command will start the backup of your sites, so be prepaired it may take a few minites depending on the size of our site.

Type the following in the command prompt:

stsadm.exe -o export -url http://(Your Site) -includeusersecurity -nofilecompression -filename d:\spbackup

Please Note:

  • I put in the command -nofilecompression becuase when i used file compression the backup failed, using this switch completed the backup with no errors.
  • Use HTTP or HTTPS depending on your setup
  • Replace the drive letter for where ever you created spbackup

Now hopefully the backup finished successfully. Your next step will be moving the spbackup folder onto the new server.

After you have moved the spbackup folder onto the new server login to the new server and repeat steps 3-6. Then when you are ready type in the following command to import the sites onto the new Sharepoint site.

stsadm.exe -o import -url https://(Your Site) -includeusersecurity -nofilecompression -filename d:\spbackup

I hope that that your import completed successfully. If you have any questions please leave a comment on this post and I will do my best to help.

- Kevin C -

- Update 6-13-07 -

I forgot an important factor while you are migrating your SharePoint Sites. You may receive an error about something like “Missing WebTemplate” or something of that nature. If you do the reason for this is because you had added an Application Template on your site and it does not exist on the new site you are trying to migrate to. This is a simple error to fix. All you need to do is add the Application Template to the new site and then try to do the migration again. Please refer to the following link to the Microsoft page explaining how to import templates onto your SharePoint site. Click Here

- Kevin Clark -

Categories: Sharepoint Tags:
  1. Nickso
    May 30th, 2007 at 09:16 | #1

    Nice post, I am going to have to do the same exact thing in a few weeks. One Question: Does the export operation happen to export the theme that is currently in use? I know I can manually move my custom theme over to the new server, I am just wondering if I will have to. Thanks

  2. clarktechie
    May 30th, 2007 at 09:32 | #2

    Hi Nickso,

    When i was watching the export happen from the command prompt i did notice that it did export the theme as well. I was using one of the Sharepoint default themes. When i did the import the theme came up just like the original. So i do believe your custom theme should be exported. Please tell me your experience after you try it. Thanks.

  3. Edwin
    September 12th, 2007 at 18:35 | #3

    Hi Kevin,

    Thanks for the post. I am currently doing this migration. Will this work even if you have your content database on another server? My sharepoint sites is in Server1 and my content database is in Server2. I need to implement the same thing in production servers.

    Thanks
    Edwin

  4. TommyK
    September 26th, 2007 at 03:53 | #4

    Kevin,

    This is a good post, and I am trying to do this at the moment to restructure our SharePoint sites. However, I’m getting an error “The specified cast is not valid” when I perform the following commands, all of which fail:
    stsadm -o export -url https://sitename -filename filepath -includeusersecurity -versions 4 -overwrite

    stsadm -o export -url https://sitename -filename filepath -nofilecompression -includeusersecurity -versions 4 -overwrite

    stsadm -o export -url https://sitename -filename filepath -nofilecompression -includeusersecurity -overwrite

    Have you seen this error before, and if so do you know why it occurs. My limited understanding of .NET tells me this is because the export is trying to convert data from one type to another and that conversion is failing – am I right?
    Thanks in advance.

  5. vishal chauhan
    August 12th, 2008 at 23:10 | #5

    hi
    Its a very nice article and it helps me a lot.

    Regards
    Vishal Chauhan

  1. No trackbacks yet.