Category | backup |
---|---|
Purpose | Creates a ZIP archive of a whole task (inkl. database dumps) before deleting a task. |
Bootstrap Class | editor_Plugins_ArchiveTaskBeforeDelete_Bootstrap |
Type | Core plug-in (delivered with translate5 core) |
This plug-in is intended to create a task archive / backup before the task will get deleted. That means the archive is created directly before delete.
The ZIP archive contains the whole task as database dumps and the task data directory. The ZIP archive is named TASKGUID.zip and is stored in the task data directory:
APPLICATION_ROOT/data/editorImportedTasks
No configuration available.
Please test this plug-in with a test task on your translate5 instance. If you getting wired DB errors on restoring your test task, this is because your DB structure was not correctly updated. Perhaps you have dismissed some minor DB updates.
Also test all features in your test task (MQM, statistics, termtagging etc) and check if all changes are restored after restoring the whole task.
Currently restoring an archive has to be done manually.
Therefore extract the zip in the task data directory
APPLICATION_ROOT/data/editorImportedTasks
then a new folder named with the Task GUID is created. In this directory you will find the tasks data and two directories "db_data" and "db_structure".
Warning 1 - use same instance: Since all numeric IDs are stored in the archived database files, the archive can only be restored in the same instance of translate5, where the task has been deleted before, or in a new translate5 instance with a empty database structure!
|
Warning 2 - what happens if database structure was updated: By updating translate5 the database structure can be changed, and differs then to the structure in the archive. To check this compare Zf_dbversion dump and the same named table in the database. If the both entries with the highest IDs are the same in the structure is identical. |
If the DB and data dump structure is the same, and you are on the same DB instance (or a fresh one), the task can simply be restored by changing to the db_data directory:
cd APPLICATION_ROOT/data/editorImportedTasks/TASKGUID/db_data
and apply all LEK_ tables to the database. The Zf_dbversion table must not be applied in this case!
under linux you can merge all data files in one file:
cat LEK_* > data.sql
then apply the merged data SQL file to the DB:
mysql -h HOSTNAME -u DBUSERNAME -p DBNAME < data.sql
And thats it. The task should be available again.
This is possible, but a little bit more complicated:
Adding the following line to your installation.ini enables debugging output for ArchiveTaskBeforeDelete Plugin.
runtimeOptions.debug.plugin.ArchiveTaskBeforeDelete = 1
With enabled debugging more information is written to the PHP error log while creating the archive.