This post describes backup and restore process of Alfresco. Here I have mentioned steps to backup alfresco's content store(alf_data), lucene index data and Database.
Alfresco Backup process:
There are two methods by which we can do alfresco backup. First one is Hot backup, when alfresco is running and you want to do backup without shutting down alfresco. Second is is Cold backup, when you can shutdown alfresco and do backup. Most of people prefer doing Hot backup, as no one will prefer to shutdown alfresco everytime before doing backup and turn back on when finished. Also hot backup also gives surety of data consistency except latest lucene index. But yes, when you restore backup from hot backup set, Alfresco will rebuild Lucene indexes. So follow below steps for Alfresco backup.
There are two methods by which we can do alfresco backup. First one is Hot backup, when alfresco is running and you want to do backup without shutting down alfresco. Second is is Cold backup, when you can shutdown alfresco and do backup. Most of people prefer doing Hot backup, as no one will prefer to shutdown alfresco everytime before doing backup and turn back on when finished. Also hot backup also gives surety of data consistency except latest lucene index. But yes, when you restore backup from hot backup set, Alfresco will rebuild Lucene indexes. So follow below steps for Alfresco backup.
Cold Backup Process:
Restore Process
1. Stop Alfresco.
2. Copy the existing dir.root to a temporary location.
3. Restore dir.root and dir.indexes from backup.
4. If you are restoring from a hot backup, rename <dir.indexes>/backup-lucene-indexes to <dir.root>/lucene-indexes.
5. Restore the database from the database backups.
6. Start Alfresco.
You would see in logs that alfresco is rebuilding indexing. But index rebuilding will be incremental so it wont take time.
- Stop Alfresco.
- Backup the database Alfresco is configured to use, using your database vendor's backup tools.
- Backup the Alfresco “dir.root” and “dir.indexes” directory. You can get location of these two paths from alfresco-global.properties file.
- Store both the database and Alfresco “dir.root/dir.indexes” backups together as a single unit. For example, store the backups in the same directory or compressed file.
- Start Alfresco.
Hot Backup Process:
It is absolutely critical that hot backups are performed in the following order:
Do not store the database and dir.root backups independently, as that makes it unnecessarily difficult to reconstruct a valid backup set for restoration.
- Make sure you have a "backup-lucene-indexes" folder under 'dir.root' if not specified separate path. Backup-lucene-indexes can be useful when you want to restore indexes.
- Backup the database Alfresco is configured to use, using your database vendor's backup tools.
- As soon as the database backup completes, backup specific subdirectories in the Alfresco dir.root.
Sub-directories
would be as listed below.
- contentstore
- contentstore.deleted
- audit.contentstore
- backup-lucene-indexes
Do not store the database and dir.root backups independently, as that makes it unnecessarily difficult to reconstruct a valid backup set for restoration.
'Note':
Alfresco generates "backup-lucene-indexes" everyday at 3:00 am, so make sure that database backup time does not overlap with this schedule. The
"backup-lucene-indexes" generation should be finished
before you start the SQL backup. So if backup-lucene-indexes is running at 3:00 am then you can set database backup at 4:00 am considering that your alfresco system is not being used during this time.
Restore Process
1. Stop Alfresco.
2. Copy the existing dir.root to a temporary location.
3. Restore dir.root and dir.indexes from backup.
4. If you are restoring from a hot backup, rename <dir.indexes>/backup-lucene-indexes to <dir.root>/lucene-indexes.
5. Restore the database from the database backups.
6. Start Alfresco.
You would see in logs that alfresco is rebuilding indexing. But index rebuilding will be incremental so it wont take time.
No comments:
Post a Comment