Merging `RSSD`s
surveilr
provides the ability to merge multiple RSSDs into one with or without SQLite.
Without sqlite3
The surveilr admin merge
prepares the SQL to merge multiple databases into one and executes it automatically creating
resource-surveillance-aggregated.sqlite.db
(you can override the name using
-d
).
With sqlite3
Generating SQL to merge multiple Resource Surveillance State SQLite Databases into one, inspecting it, and then executing using sqlite3
:
admin merge --sql-only
Merging multiple database can sometimes fail due to unforseen data issues, you can use sqlite3
to merge multiple databases using
surveilr
-generated SQL after inspecting it. Here’s how:
The CLI multi-command pipe above does three things:
surveilr admin init
initializes an emptytarget.sqlite.db
(-r
removes it if it exists)surveilr admin merge --sql-only
generates the merge SQL for all databases excepttarget.sqlite.db
; to inspect the SQL you can save it to a filesurveilr admin merge -d target.sqlite.db --sql-only > merge.sql
.sqlite3
pipe at the end just executes the generated SQL using SQLite 3 shell and produces mergedtarget.sqlite.db
Once target.sqlite.db
is created after step 3, none of the original device-specific RSSD
s are required and target.sqlite.db
is independent of surveilr
as well.