TACTIC Open Source
how to backup a single project database and restore it? - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: how to backup a single project database and restore it? (/showthread.php?tid=24)

Pages: 1 2


how to backup a single project database and restore it? - EricTsuei - 11-08-2019

how to backup a single project database and restore it?

I know pg-dumpall can backup all databases. 
but what if I only need backup single project? how to do it?
and how to restore it? 
restore entire project or only restore task, asset, shot or other stype datas?


RE: how to backup a single project database and restore it? - listy - 11-08-2019

Hi. Project database table contains only SObjects and Search Types definitions. Also some configs are stored here to. But all other data, like notes, tasks, snapshots and files are stored in sthpw db.


RE: how to backup a single project database and restore it? - EricTsuei - 11-12-2019

(11-08-2019, 10:59 PM)listy Wrote: Hi. Project database table contains only SObjects and Search Types definitions. Also some configs are stored here to. But all other data, like notes, tasks, snapshots and files are stored in sthpw db.

but how should I do if I need to backup projects and restore it by projects?


RE: how to backup a single project database and restore it? - listy - 11-12-2019

(11-12-2019, 09:50 AM)EricTsuei Wrote:
(11-08-2019, 10:59 PM)listy Wrote: Hi. Project database table contains only SObjects and Search Types definitions. Also some configs are stored here to. But all other data, like notes, tasks, snapshots and files are stored in sthpw db.

but how should I do if I need to backup projects and restore it by projects?
How about creating one TACTIC server per project?


RE: how to backup a single project database and restore it? - Celton McGrath - 11-12-2019

Hi Eric,

I think this is a great question. Normally, I would only backup and restore data in the project database.

Some data will be stored in the global sthpw database, and this will remain there.

One other option, which is what Listy suggested, is to have a TACTIC server per project.

Another option is to use a TACTIC plugin to dump and restore the data. The plugin manifest can be written in a way that would retrieve data related to your project. This could be time consuming though, depending on how many search types you have in your project database, and how many related tables you are using in the sthpw database.

- Celton


RE: how to backup a single project database and restore it? - EricTsuei - 11-13-2019

so, where is the backup and restore plugin?
and how to use pgsql cmds to restore complete database?


RE: how to backup a single project database and restore it? - listy - 11-13-2019

(11-13-2019, 04:11 AM)EricTsuei Wrote: so, where is the backup and restore plugin?
and how to use pgsql cmds to restore complete database?
I guess you should do it by yourself  Angel

About backups. I am doing it really easy with WEBMIN


RE: how to backup a single project database and restore it? - Celton McGrath - 11-13-2019

You can create your own plugin using the plugin manager. Access the plugin manager by navigating to the admin site:

URL: <ip>/tactic/project/admin

and enter the key "2".

This will give an overlay, where you can access Plugins.

You can access the TACTIC Developer documentation, which contains a section on Plugins, here:[/url]

[url=https://github.com/Southpaw-TACTIC/TACTIC/blob/4.6/doc/book/doc/doc_tactic-developer/tactic-developer.pdf]https://github.com/Southpaw-TACTIC/TACTIC/blob/4.6/doc/book/doc/doc_tactic-developer/tactic-developer.pdf


I would add to the documentation that you export specific entries in a table using expressions:

Code:
<sobject search_type="config/widget_config" path="config/custom_layouts" expression="@SOBJECT(config/widget_config['view','like','my_custom_view.%'])" ignore_columns="timestamp,code,id" relative_dir_column="view"/>

I don't usually use plugins for backup and restore, although it is possible. I usually use plugins to transfer custom views and widgets across projects.

I hope this helps!

- Celton


RE: how to backup a single project database and restore it? - remkonoteboom - 11-13-2019

Without resorting to using pg_dump or mysqldump, the best way to export the data is through a plugin, however it is not clear why you would use this instead of a database dump as this essentially does the same thing.  The advantage of a plugin is, of course, that you can load it into other projects.  We usually have create a number of different plugins for different purposes, although you can combine them into one if you wish:

1) Database structure plugin (or stypes plugin)
2) Configuration plugin
3) Data plugin

The contents of a plugin from the database are determined by the manifest file ($BASE_PLUGIN_DIR/manifest.xml) and it looks like the following:

This will export (and import) the structure of the asset and shot tables.

Code:
<manifest code="vfx_types">
  <search_type code="vfx/asset"/>
  <search_type code="vfx/shot"/>
</manifest>


This will export (and import) the contents of the asset and shot tables

Code:
<manifest code="vfx_data">
  <sobject search_type="vfx/asset"/>
  <sobject search_type="vfx/shot"/>
</manifest>


You could also export (and import) part of the table using expressions:

Code:
<manifest code="vfx_data">
  <sobject search_type="vfx/asset" expression="@SOBJECT(vfx/asset['category','character'])"/>
  <sobject search_type="sthpw/task" expression="@SOBJECT(sthpw/task['project_code','my_project'])">
</manifest>


The first line will export all assets with a category of character.  The second line will export all tasks with a project code of "my_project".


RE: how to backup a single project database and restore it? - EricTsuei - 11-18-2019

this plugin I need to create by myself, right?
but at this moment, I just need to know a quick way, using a pgsql command to restore my all database.
just don't know the right way.