Documentation
¶
Overview ¶
Package migrate provides tooling to migrate data from InfluxDB 1.x to 2.x
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
Term uint64 // associated raft term
Index uint64 // associated raft index
ClusterID uint64
Databases []DatabaseInfo
MaxShardGroupID uint64
MaxShardID uint64
}
Data represents the top level collection of all metadata.
func (*Data) UnmarshalBinary ¶
UnmarshalBinary decodes the object from a binary format.
type DatabaseInfo ¶
type DatabaseInfo struct {
Name string
DefaultRetentionPolicy string
RetentionPolicies []RetentionPolicyInfo
}
DatabaseInfo represents information about a database in the system.
type Migrator ¶
type Migrator struct {
Config
// contains filtered or unexported fields
}
A Migrator migrates TSM data from a InfluxDB 1.x to InfluxDB 2.x.
func NewMigrator ¶
func (*Migrator) Process1xShard ¶
Process1xShard migrates the TSM data in a single 1.x shard to the 2.x data directory.
First, the shard is checked to determine it's fully compacted. Hot shards are not migrated by default as the WAL is not processed, which could lead to data loss. Next, each TSM file contents is checked to ensure it overlaps the desired time-range, and all matching data is migrated.
func (*Migrator) Process1xShards ¶
Process1xShards migrates the contents of any matching 1.x shards.
The caller can filter shards only belonging to a retention policy and database. Providing the zero value for the filters will result in all shards being migrated, with the exception of the `_internal` database, which is never migrated unless explicitly filtered on.