How to restore tasks to a site that’s been deactivated

Please Note : This Knowledgebase Article requires you to have recent backup’s of the DocRead database and the SharePoint content database. If you don’t have these, then this solution is not  possible. There are methods to restore tasks from receipts, but this is far more complicated and relies on a custom Powershell scripts to be custom developed for you organization.

So, If you have access to those back-ups, let’s get started :

Firstly, a quick primer – If you deactivate the ‘DocRead Site feature‘ at any given site – the following will happen :

  • All tasks (and site info) corresponding to that site are deleted from the DocRead database.
  • The ‘Required’ and ‘Recommended’ Audiences assigned to each document, is cleared away.

At this point, DocRead effectively no longer knows anything about the site. (However, it does still have the Receipts).

If you deactivate the ‘DocRead Site Collection Feature‘ then this deactivates ALL of the ‘DocRead Site Features’ in all of it’s child sub-sites.

We built DocRead so that a site / site collection isn’t left in a state where various components from DocRead are left in your SharePoint farm. In short, it’a like any other program you buy, if you deactivate (uninstall) it – it cleans up after itself as it assumes you no longer want it on that site.

However, if you deactivate one of your site features by mistake, then you will need to follow these steps to get your tasks back. It is very important you follow the steps in this order.

Steps:

  • Temporarily disable all of the following DocRead Timer Jobs. This can be done from Central Admin.310-1
  • Disable the DocRead Notification Scheduler.

310-2

  • Ensure the ‘DocRead Site Collection Feature’ is activated.

310-1.5

  • For each sub-site (where DocRead used to be activated upon) you will need to do the following :
    • Activate the ‘DocRead Site Features’ (and the two Reporting ones if you use it)

310-3

  • Restore the most recent DocRead Database to SQL with exactly the same name as before. (Find the most recent DocRead database backup you have. This should be the one before the feature was deactivated. Once you have it – restore it.)
  • For each sub-site (where DocRead used to be activated upon) do the following :
    • Navigate to ‘DocRead site settings’ screen. (At this point you should see the document libraries that were set from before). This is now being pulled from your restored database. Click “ok“. This step is very important. Click “ok” not “cancel“.

 

DocRead site settings OK

Now you are ready to bring back your SharePoint content from your backup.

Steps:

  1. Restore a back-up of your SharePoint Site Collection to a test server. The back-up needs to be a recent as possible, but before you accidentally deactivated the feature(s).
  2. Once you have this in-place, verify all of the documents are back in place and that you are happy it worked.
  3. Please Note : It is vitally important that all the internal SharePoint GUIDs (for the web, document library and documents) remain in tact. These are what DocRead uses to map reading tasks to documents. Please do not delete the site in the source.
  4. Load Powershell and use the ‘Export-SPWeb‘ command to export the site from the test server. For example :
    1. Export-SPWeb -Identity http://testportal.ad2008r2.loc/CollaborisHealthcare  -Path c:docread.bak -IncludeUserSecurity -IncludeVersions
  5. Now it’s time to restore the site back into the production site. To this you use the ‘Import-SPWeb‘ command :
    1. Import-SPWeb -Identity http://liveportal.ad2008r2.loc/CollaborisHealthcare -UpdateVersions Add -IncludeUserSecurity -Path c:docread.bak -force

Finally, once this is done, verify the tasks are all working and send out a test document to yourself in the newly restored site. Once you are happy everything is working, restart the following:

  • DocRead Notification Scheduler.
  • SharePoint DocRead timer jobs.