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.

  2. Thank’s a lot for your help, I tested this tuto and alos backup tuto .
    Work fine for me.

Leave a Reply to Francesco Corti Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s