usage: fcpc db [-h] [--db.force_erase {0,1}]
[--db.reindex.epochs DB.REINDEX.EPOCHS]
[--db.reindex.config {0,1}] [--db.reindex.state {0,1}]
[--db.reindex.global {0,1}] [--db.reindex.views {0,1}]
[--db.lock.force_remove {0,1}] [--db.lock.steal {0,1}]
[--db.cleanup.dry {0,1}] [--db.export.format {cli,fcpx}]
[--db.export.globals {0,1}] [--db.export.config {0,1}]
[--db.export.epochs DB.EXPORT.EPOCHS] [--db.export.tag {0,1}]
[--db.export.objects {0,1}] [--db.export.links {0,1}]
[--db.export.fcpc DB.EXPORT.FCPC]
[--db.export.continue_on_error DB.EXPORT.CONTINUE_ON_ERROR]
[--db.imp.continue_on_error DB.IMP.CONTINUE_ON_ERROR]
{check,clean-deleted,clean-state,cleanup,drop,erase,export,import,init,reindex,show-actual-mappings,show-required-mappings,status,unlock,update,version}
[subdata ...]
positional arguments:
{check,clean-deleted,clean-state,cleanup,drop,erase,export,import,init,reindex,show-actual-mappings,show-required-mappings,status,unlock,update,version}
Databse management command
Choices:
check
clean-deleted
clean-state
cleanup
drop
erase
export
import
init
reindex
show-actual-mappings
show-required-mappings
status
unlock
update
version
subdata Data for command (default: None)
optional arguments:
-h, --help show this help message and exit
--db.force_erase {0,1}
[Defined:fcplib.cmd.db] (default: 0)
Choices:
0
1
--db.reindex.epochs DB.REINDEX.EPOCHS
eindex global[Defined:fcplib.cmd.db] (default: 0)
--db.reindex.config {0,1}
Reindex config[Defined:fcplib.cmd.db] (default: 1)
Choices:
0
1
--db.reindex.state {0,1}
Reindex state[Defined:fcplib.cmd.db] (default: 1)
Choices:
0
1
--db.reindex.global {0,1}
Reindex views[Defined:fcplib.cmd.db] (default: 1)
Choices:
0
1
--db.reindex.views {0,1}
Reindex views[Defined:fcplib.cmd.db] (default: 0)
Choices:
0
1
--db.lock.force_remove {0,1}
[Defined:fcplib.cmd.db] (default: 0)
Choices:
0
1
--db.lock.steal {0,1}
Steal a lock, if it's ID is not
active.[Defined:fcplib.cmd.db] (default: 1)
Choices:
0
1
--db.cleanup.dry {0,1}
[Defined:fcplib.cmd.db] (default: 0)
Choices:
0
1
--db.export.format {cli,fcpx}
Export format.[Defined:fcplib.cmd.db] (default: cli)
Choices:
cli
fcpx
--db.export.globals {0,1}
Export global objects[Defined:fcplib.cmd.db] (default:
1)
Choices:
0
1
--db.export.config {0,1}
Export config objects[Defined:fcplib.cmd.db] (default:
1)
Choices:
0
1
--db.export.epochs DB.EXPORT.EPOCHS
Export epochs. Default is all. You can specify number
which means all n last epochs[Defined:fcplib.cmd.db]
(default: {all})
--db.export.tag {0,1}
Tag exported objects by
'sys:exported'[Defined:fcplib.cmd.db] (default: 1)
Choices:
0
1
--db.export.objects {0,1}
Export objects[Defined:fcplib.cmd.db] (default: 1)
Choices:
0
1
--db.export.links {0,1}
Export links[Defined:fcplib.cmd.db] (default: 1)
Choices:
0
1
--db.export.fcpc DB.EXPORT.FCPC
FCPC cli command[Defined:fcplib.cmd.db] (default:
fcpc)
--db.export.continue_on_error DB.EXPORT.CONTINUE_ON_ERROR
Continue on error during export[Defined:fcplib.cmd.db]
(default: 0)
--db.imp.continue_on_error DB.IMP.CONTINUE_ON_ERROR
Continue on error during import[Defined:fcplib.cmd.db]
(default: 0)
Database must be prepared before first use. For this, use.
Caution: This will remove all data within existing database!
fcpc db erase
Database has internal versioning. You cannot use older version of database with newer version of platform.
If upgrade is needed, error is shown that database needs to be upgraded. At this case, use
fcpc db update
Sometimes databse cannot be updated in place and must be reindexed (for example during major db changes)
This command will reindex current db to new prefix 'newprefix'.
Note that views are not reindexed. They must me rerun.
fcpc db reindex newprefix.
To export database into CLI format and output to stdout
By default, all epochs and globals are exported.
Internal objects and tags are not exported.
fcpc db export | gzip >export.cli.txt.gz
To export last three epochs:
db --db.export.epochs=3 export | gzip >export.cli.txt.gz
To export only objects by query
db export asset+ tag="some:tag"
To export in p=fcpx format (this is quicker way but export file is unreadable)
db --db.export.format=fcpx db export | gzip >export.fcpx.gz
By default, export is readable and importable by fcpc shell
zcat export.cli.txt.gz | fcpc shell
To import fcpx file
zcat export.fcpx.gz | fcpc db import
If there are some problems with DB, you can use these commands:
To remove stale lock of DB. Please ensure first, that there is no other fcpc running before this
fcpc db unlock
To remove stale transactions and progress, use command below. It will remove all state entries older than one minute.
fcpc db clean-state
To cleanup bad objects from DB, use command below. It will delete all objects which are in transaction state and bad objects.
fcpc db cleanup
To remove objects taged to be removed from ALL epochs
fcpc db clean-deleted