Alfresco’da veri yedekleme yöntemi 2 – Alfresco Hot Backup Yapmak

Sıcak Backup İşlemi

This section describes the procedure for performing at hot backup.

The high-level procedure for a hot backup is:
Back up Lucene.
Back up SQL.
Back up files.
Lucene indexes have to be backed up first and before SQL because if new rows are added in SQL after the Lucene backup is done, a Lucene reindex (AUTO) can regenerate the missing Lucene indexes from the SQL transaction data.

SQL has to be done before backing up the files because if you have a SQL node pointing to a missing file, then that node will be an orphan. Also, if you have a file without SQL node data, this means that the user has added the file too late to be included in a backup.

It is critical to perform hot backups in the following order of steps:

  • Ensure that you have a backup-lucene-indexes directory under dir.root.

  • 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 file system Alfresco dir.root.

  • Store both the database and Alfresco dir.root backups together as a single unit.

For example, store the backups in the same directory or in a single compressed file. Do not store the database and dir.root backups independently, as that makes it difficult to reconstruct a valid backup set, if restoration becomes necessary.

  • Store both the database and dir.root backups together as a single unit.

  1. Ensure that the cron generated in the backup-lucene-indexes does not run while you do the SQL backup. The backup-lucene-indexes generation should be finished when you start the SQL backup.

  2. If you set system.content.eagerOrphanCleanup=true in the alfresco-global.properties file, performing a hot backup is not recommended. Actions taken between the database backup and the file system backup have the potential to cause orphaned nodes in the repository.

Alfresco includes a background job responsible for backing up the Lucene indexes that (by default) is configured to run at 3am each night. The hot backup process must not run concurrently with this background job, so you should either ensure that the hot backup completes by 3am, or wait until the index backup job has completed before initiating a hot backup.

Refreshing the backup Lucene indexes (optional)

This is an optional step before initiating a hot backup.

 

  1. Trigger a Lucene index backup using JMX, and it can be done several ways, including using:

    The backup can be done in several ways, including:

    • VisualVM
    • JConsole (MBeans tab -gt Alfresco/Schedule/DEFAULT/MonitoredCronTrigger/indexBackupTrigger/Operations – executeNowbutton)
    • Command line
    http://docs.alfresco.com/4.1/topic/com.alfresco.enterprise.doc/images/note.png); background-repeat: no-repeat no-repeat;”>During the creation of the backup Lucene indexes, the system is placed in read-only mode, which could last several minutes depending on the size of the Lucene indexes.

     

  2. After completing this operation, the backup-lucene-indexes directory contains an up-to-date cold copy of the Lucene indexes, ready to be backed up.

 

Backing up the database

In an Alfresco system, the ability to support hot backup is dependent on the hot backup capabilities of the database product Alfresco is configured to use.

Database hot backup requires a tool that can “snapshot” a consistent version of the Alfresco database (that is, it must capture a transactionally-consistent copy of all the tables in the Alfresco database). In addition, to avoid serious performance problems in the running Alfresco system while the backup is in progress, this “snapshot” operation should either operate without taking out locks in theAlfresco database or it should complete quickly (within seconds).

Backup capabilities vary widely between relational database products, and you should ensure that any backup procedures that are instituted are validated by a qualified, experienced database administrator before being put into a production environment.

Backing up the file system

This section describes the process for backing up the file system.

Backup the following subdirectories of the Alfresco dir.root directory using whatever tools you are comfortable with (rsyncxcopy):

  • contentstore
  • contentstore.deleted
  • audit.contentstore
  • backup-lucene-indexes
http://docs.alfresco.com/4.1/topic/com.alfresco.enterprise.doc/images/note.png); background-repeat: no-repeat no-repeat;”>Do not attempt to backup the lucene-indexes subdirectory while Alfresco is running. This will cause Lucene index corruption. Use backup-lucene-indexes instead.