Last week we were working on a load test to upload one million documents to our internal Alfresco server by using 5.1.e release.
However, we forget about our CentOS 6 configuration, which was only accepting 1 million inodes. So, our test were abruptly terminated when there was no more inodes.
$ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/vzfs 1000000 997947 2053 100% / none 1572864 154 1572710 1% /dev
As it was just only a dev server, we thought about restoring our weekly backup produced by our
First of all: get some space free in the system. Current file system for Alfresco repository, including half a million files, was removed.
$ service alfresco stop $ cd /opt/alfresco $ rm -rf alf_data
Time to prepare our backup: postgreSQL dump and alf_data folder packaged together.
$ cd /opt/alfresco-backup $ cp alfresco-backup-03_14_2016.tar.gz /tmp $ cd /tmp $ tar xvf alfresco-backup-03_14_2016.tar.gz $ cd tmp/03_14_2016 $ ls alf_data.tar.gz pgdump_alfresco.sql
With alfresco stopped, a PostgreSQL DUMP restoration can be performed.
$ su - postgres postgres=# drop database alfresco; DROP DATABASE postgres=# CREATE DATABASE alfresco postgres-# WITH OWNER = postgres postgres-# ENCODING = 'UTF8' postgres-# TABLESPACE = pg_default postgres-# LC_COLLATE = 'es_ES.utf8' postgres-# LC_CTYPE = 'es_ES.utf8' postgres-# CONNECTION LIMIT = -1 postgres-# TEMPLATE template0; CREATE DATABASE postgres=# GRANT ALL ON DATABASE alfresco TO public; GRANT postgres=# GRANT ALL ON DATABASE alfresco TO postgres; GRANT postgres=# GRANT ALL ON DATABASE alfresco TO alfresco; GRANT postgres=# \q $ psql alfresco < /tmp/tmp/03_14_2016/pgdump_alfresco.sql $ exit
Once the database is up and ready, alfresco repository file system can be also restored.
$ cd /tmp/tmp/03_14_2016 $ tar xvf alf_data.tar.gz $ cd opt/alfresco $ mv alf_data /opt/alfresco $ service alfresco start
Finally, having tested that our system was working properly, all temporal resources can be removed.
$ cd /tmp $ rm -rf tmp $ rm -rf alfresco-backup-03_14_2016.tar.gz $ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/vzfs 1000000 135588 864412 14% / none 1572864 154 1572710 1% /dev
By using a correct generated and stored Alfresco backup, just 10 minutes are required to bring back to life any Alfresco installation.
This methods may not be ready to production environments, some cautions have been omitted because of our dev environment. However, main steps are equivalent to restore Alfresco in both prod and dev environments.