Datapolis Process System
Restoring Web Application from farm backup (Sharepoint 2013)
If you want to restore single Web Application from backup, please follow below steps.
USE <DP_DB_guid_of_your_2013_SPFarm>
DECLARE
@appId uniqueidentifier =
'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -- id of the web application which content is being restored
DELETE
FROM
[dbo].Associations
WHERE
AppId=@appId
GO
[dbo].History
[dbo].Tasks
[dbo].WBXml
--from
--TEMPORARY DB <temporary_database_name>
--to
--DESTINATION DB <destination_DP_DB_2013_database_name>
-- remeber to replace databasenames in scrips !!!
SET
STATISTICS
TIME
ON
@TranName
VARCHAR
(50);
@TranName =
'MigrateContent'
;
BEGIN
TRANSACTION
@TranName;
INSERT
INTO
<DP_DB_guid_of_your_2013_SPFarm>.[dbo].[Associations]
([AssociationId]
,[AppId]
,[SiteId]
,[WebId]
,[ListId]
,[AssociationType]
,[AssociationContent]
,[WBVersion]
,[AssociationReferenceId])
SELECT
[AssociationId]
,[AssociationReferenceId]
<temporary_database_name>.[dbo].[Associations]
[AppId] = @appId
<DP_DB_guid_of_your_2013_SPFarm>.[dbo].[History]
([WorkflowInstanceId]
,[AssociationId]
,[TemplateId]
,[ItemId]
,[UserId]
,[UserLogin]
,[Occured]
,[EventType]
,[EventName]
,[EventTitle]
,[EventContent]
,[HideInHistory])
[WorkflowInstanceId]
,[HideInHistory]
<temporary_database_name>.[dbo].[History]
<DP_DB_guid_of_your_2013_SPFarm>.[dbo].[WBXml]
([AppId]
,[BaseId]
,[WorkflowInstanceId]
,[StateTitle]
,[ShowActions]
,[WBXmlContent]
,[AssignedTo]
,[Status]
,[StatusDetails]
,[StatusLog]
,[DateOfLastUpdate])
[AppId]
,N
'Active'
'Normal'
'Migration'
,@now
<temporary_database_name>.[dbo].[WBXml]
<DP_DB_guid_of_your_2013_SPFarm>.[dbo].[Tasks]
([TaskType]
,[CreatedBy]
,[Created]
,[Started]
,[Finished]
,[TaskState]
,[Progress]
,[ItemIds]
,[WorkflowId]
,[WorkflowIds]
,[TaskContent]
,[Result]
,[StartDate]
,[ActionName]
,[StateInstanceId]
,[Errors]
,[LockedBy]
,[LockedDate]
,[Priority]
,[RemovedDate]
,[LockId]
,[TriesLeft]
,[RetryInterval])
[TaskType]
,[RetryInterval]
<temporary_database_name>.[dbo].[Tasks]
COMMIT
@TranName; SET STATISTICS TIME OFF