All persisted database objects (tables, collections, etc.) can be backed up to
disk while the system is in a semi-operational state. During the backup
sequence, the system will not accept most types of requests in order to ensure
the integrity of the backup being made. Backing up Kinetica involves invoking
the /admin/offline endpoint with the flush_to_disk
option set to true
.
Make the database go offline
response = h_db.admin_offline(offline = True, options = {'flush_to_disk':'true'})
Tar (or zip) the persist folder and copy it elsewhere (a placeholder directory is used in this example)
shutil.make_archive('/tmp/persist-backups/persist-' + ts, 'gztar', '/tmp/persist-backups', '/opt/gpudb/persist')
Turn the database back online
response = h_db.admin_offline(offline = False)