12 Feb

Alfresco restore from a cold backup

1359432616_backupIn the Alfresco wiki is described the backup and restore strategy but is not so clear how to do it in detail. In this post is shared a practical way to perform a restore of a backuped Alfresco in the way I like: a list of commands and tasks to execute… simpler to understand, to do and to test.

In this example is supposed that Alfresco is alfresco-logo.pnginstalled in ‘/opt/alfresco’ folder and the DBMS used is PostgreSQL. The restore strategy supposes that the backup is done as a “cold backup” described in this ‘Alfresco backup script‘ post.

Let’s start…

First of all proceed to stop alfresco.

service alfresco stop

Supposing the DBMS runs using the ‘postgres’ user, proceed as first task to restore the PostgreSQL database.

su - postgres
psql
DROP DATABASE alfresco;
CREATE DATABASE alfresco WITH OWNER alfresco;

Digit CTRL+d to exit from the shell.

psql -U alfresco -d alfresco
ALTER USER alfresco WITH PASSWORD 'alfresco';

Digit CTRL+d to exit from the shell. Supposing the DBMS backup is stored in the ‘alfresco_postgres.tar’ file conforming to the backup strategy described here, let’s go ahead with the restoring of the database.

pg_restore -d alfresco alfresco_postgres.tar
exit

Now it’s time to restore the ‘alf_data’ folder with documents and indexes. Also in this case is supposed that the files are stored in a ‘alfresco_data.tgz’ file conforming to the backup strategy described here.

cd /opt/alfresco
mv alf_data alf_data.old
tar zxvf alfresco_data.tgz

That’s all!
Now it’s time to start again Alfresco and use it normally.

service alfresco start

3 thoughts on “Alfresco restore from a cold backup

  1. Hi Franceso,

    Thanks for the very clear explanation.

    In order to drop the database I did:

    service alfresco stop
    su – postgres
    . .environment-9.0.4 (I added this line)
    psql
    bla bla

    With help of your explanations, I could run the backup script and restore manually my alfresco fresh installation within 10 minutes !!

    Thanks very much.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.