01-11-2012 09:16 AM
pg_dump -U alfresco alfresco > E:\sauvegarde\postgresql\alfresco_hot.sql
psql –set ON_ERROR_STOP=on -U alfresco alfresco < E:\sauvegarde\postgresql\alfresco_hot.sql
Résultat :SET
SET
SET
SET
SET
SET
ERREUR: doit être le propriétaire du langage plpgsql
CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;
ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO "SYSTEM";
01-11-2012 03:43 PM
echo off
echo.
echo ################################
echo ### DUMP Postgresql Alfresco ###
echo ################################
echo.
pg_dump -U alfresco alfresco > E:\sauvegarde\postgresql\alfresco_hot.sql
echo.
echo ############################################
echo ### Sauvegarde Alfresco alf_data ###
echo ############################################
echo.
robocopy E:\alfresco4\alf_data\contentstore\ E:\sauvegarde\dir.root\contentstore\ /mir /r:1 /w:1 > E:\sauvegarde\backup_hot.log
robocopy E:\alfresco4\alf_data\contentstore.deleted\ E:\sauvegarde\dir.root\contentstore.deleted\ /mir /r:1 /w:1 >> E:\sauvegarde\backup_hot.log
robocopy E:\alfresco4\alf_data\solr\ E:\sauvegarde\dir.root\solr\ /mir /r:1 /w:1 >> E:\sauvegarde\backup_hot.log
robocopy E:\Alfresco4\alf_data\postgresql\ E:\sauvegarde\dir.root\postgresql\ /mir /r:1 /w:1 >> E:\sauvegarde\backup_hot.log
robocopy E:\Alfresco4\alf_data\keystore\ E:\sauvegarde\dir.root\keystore\ /mir /r:1 /w:1 >> E:\sauvegarde\backup_hot.log
echo.
echo ####################################
echo ### Sauvegarde a chaud terminee. ###
echo ####################################
@echo off
set log=E:\sauvegarde\update.log
date /t > %log% & time /t >> %log%
echo.
echo ########################################################
echo ### L INSTANCE POSTGRESQL DOIT ETRE UP ###
echo ### L INSTANCE TOMCAT DOIT ETRE DOWN ###
echo ########################################################
echo.
:pause
pause
tasklist | findstr -i tomcat6.exe
if %ERRORLEVEL%==0 goto pause
goto next
:next
echo ### TOMCAT DOWN - ON CONTINUE 🙂 ###
echo.
echo ### RESTAURATION DU CONTENU Alfresco ###
echo.
robocopy E:\alfresco4\alf_data\ E:\sauvegarde\alf_data\ /mir /r:1 /w:1 >> %log%
rd E:\Alfresco4\alf_data\contentstore\ /s /q >> %log%
rd E:\Alfresco4\alf_data\contentstore.deleted\ /s /q >> %log%
rd E:\Alfresco4\alf_data\solr\ /s /q >> %log%
rd E:\Alfresco4\alf_data\keystore\ /s /q >> %log%
robocopy E:\sauvegarde\dir.root\ E:\alfresco4\alf_data\ /mir /r:1 /w:1 >> %log%
echo.
echo ### RESTAURATION DB postgresql ###
echo.
psql -U postgres -c "drop database alfresco;"
psql -U postgres -c "create database alfresco;"
psql -U postgres -c "grant all privileges on database alfresco to alfresco;"
psql -U alfresco alfresco < E:\sauvegarde\postgresql\alfresco_hot.sql
date /t >> %log% & time /t >> %log%
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.