D
D
Dmitry Shumov2022-03-29 09:31:39
SharePoint
Dmitry Shumov, 2022-03-29 09:31:39

How to restore Sharepoint 2010?

Colleagues, tell me if such a recovery plan is real, or give at least some ideas for recovering / extracting information.
There is a server with Sharepoint 2010, the configuration database is irrevocably corrupted, because when accessing the portal, an error is generated: "Failed to connect to the configuration database." The content database is the whole, by request, I can see the docks that are in it. Save, pull out individual files does not work. Below I will give the requests that I tried to do this. There is an idea to raise a new server with Sharepoint and connect a content database to it. Will it roll? When launching the "Sharepoint Products Configuration Wizard" an error pops up:
6242a698d1bff032258726.pngDo you have any advice, it is indicated there, namely: disconnecting from the server farm, creating a new farm, and will it be possible to connect the old content database there?

SQL queries to list content

use [SharePoint_Portal];
set nocount on
 
select
    'database'  = db_name()
,   'time_created'  = left(alldocs.timecreated, 19)
,   'list_name' = alllists.tp_title
,   'file_name' = alldocs.leafname
,   'url'       = alldocs.dirname
,   'last_url_folder' = right(alldocs.dirname, charindex('/', reverse('/' + alldocs.dirname)) - 1)
from
    alldocs join alldocstreams  on alldocs.id=alldocstreams.id 
    join alllists           on alllists.tp_id = alldocs.listid
order by
    alldocs.timecreated desc
,   alldocs.dirname


SQL query for exporting documents from the content database

use SharePoint_Portal
set nocount on
 
declare @ole_automation int
set     @ole_automation = (select cast([value_in_use] as int) from sys.configurations where [configuration_id] = '16388')
if      @ole_automation = 0
    begin
    exec sp_configure 'Ole Automation Procedures', 1; reconfigure with override;
    end;
go
 
use tempdb;
set nocount on
 
declare @url            varchar(1000)
declare @list           varchar(255)
declare @file           varchar(255)
declare @database       varchar(255)
declare @extension      varchar(5)
declare @destination_path   varchar(255)
/********************************************************************/
set @database   = 'WSS_Content'
set @list   = 'Документы'
set @file   = '"График домашнего дежурства 2 линии.2022.xlsx"'
set @url    = 'support/Documents/Справочная информация по отделу ТП'
/********************************************************************/
set @extension = (select reverse(left(reverse(@file),charindex('.',reverse(@file))-1)))
set @destination_path   = '\\APPLE\Export\' + @file
 
declare @extract_file   varchar(max)
set @extract_file   = 
'use [' + @database + '];
set nocount on;
 
declare @object_token int
declare @content_binary varbinary(max)
select  @content_binary = alldocstreams.content from alldocs join alldocstreams on alldocs.id = alldocstreams.id join alllists on alllists.tp_id = alldocs.listid
where  
    alllists.tp_title   = ''' + @list + '''
    and alldocs.leafname    = ''' + @file + '''
    and alldocs.dirname = ''' + @url  + '''
 
exec sp_oacreate ''adodb.stream'', @object_token output
exec sp_oasetproperty @object_token, ''type'', 1
exec sp_oamethod @object_token, ''open''
exec sp_oamethod @object_token, ''write'', null, @content_binary
exec sp_oamethod @object_token, ''savetofile'', null, ''' + @destination_path + ''', 2
exec sp_oamethod @object_token, ''close''
exec sp_oadestroy @object_token
'
exec    (@extract_file)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2022-03-29
@firedragon

Look at the log that is in the error, maybe there will be something there.
And so, connect the WSS_Content database to the newly created Sharepoint instance and everything will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question