I am trying to find the best way to accomplish the following: Move an existing share point application's content and meta databases, back them up and restore them to a different machine. In order to do this I am using the stsadm tool as follows: To backup, I use this command:
stsadm -o backup -url http://devpn-004:1234 -directory c:\sharePointBackup -filename testBackup.bak -backupmethod full -percentage 10
To restore, I use this command:
stsadm -o restore -url %1 -directory c:\sharePointBackup -restoremethod overwrite -percentage 10
The backup completes successfully. However, when I try to restore, I get the following errors:
Provisioning of the web application, SharePoint - 1234, has encountered the following error: System.ArgumentException: The IIS Web Site you have selected is in use by SharePoint.
You must select another port or hostname.
Object MySharepointDB1234 failed in event OnRestore. For more information, see the error log located in the backup directory.
SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.
The machine on which the restore takes place already has an existing web application at the port specified, and since the overwrite flag is used, I would expect no errors. I would appreciate any help and insight on the best practice to backup from machine a and restore to machine b a complete application.