How To Use Archiving System

How To showing how to use the archiving system to move objects to another database (archive)
  • Last Update:2016-02-09
  • Version:001
  • Language:en

Archiving system is use to move object from the catalog to another database (the archive), thus allowing to have less lines in the catalog and better performance. The archive can still be used to see these former object, you just have to choose it in your preference.

Table of Contents

Requirement

You need products with revision after r16293, erp5_core with revision after r16262 and the last business templates erp5_archive installed.

How to create an archive

To use the archiving system, you need to create two archive, one wich will be used to store former object and one that will stored current data.

To create those archive, you need one catalog per archive, 2 connections (the usual one plus the deferred one) per archive.

Once all is created, go to portal_archive (Action "Manage Archive"). Create a first archive object that will be used for the archive you want, defined catalog, connection id. Usually archive will be created based on date defined on document, so you should define min and max date for the archive, but you can use any other properties as Archive object are Predicate. If you use date, you must defined the script used to test these date, erp5_archive provide the script Archive_test for it. It's also need to set the script used to create inventory related to the archive, erp5_archive provide the script Archive_createAllInventory wich will create archive per node_uid and payment_uid. You can customize all this script as you wish. Once all is defined, set the archive 'Ready to use' (Action menu)

Then you need an archive for you future current catalog. Just do the same as before, here you don't need to defined the inventory method, and you will probably use the same test script as the one defined in the previous archive. Note that if you use date, your min date must be equal to the max date of the previous archive. Then set the archive 'Ready to use' (Action menu).

The action 'Ready to use' will automatically set hours to 23:59:59 on both stop and start date defined on the archive.

Once all defined, click the export button in the Archive Tool, defined archive object for the archive and the destination and check if you to update connection id in your zsql method. Then just do archiving. It will launch everything as activity to do the migration.

As archiving is based on hot reindexing, you can still use your site while archiving, everything is transparent for the user.

Usage

Just go to your preference, and select the archive you want to use, thus erp5 will use the catalog from these archive and you will only see objects in module from it. When you want to reuse the current catalog just set the archive to None or to the current one in your preference.

Related Articles