Skip to main content

InfluxDB 1.x Business Cutover

note

When migrating an InfluxDB 1.x workload to TDengine, first protect incremental data, backfill history, catch up, and verify. Then gradually switch queries. T0 is the business timestamp dividing history from incremental data, not the task creation time. Enterprise tasks and taosAdapter use different default child-table naming schemes; mixing them creates two sets of tables.

Where to operate: InfluxDB ingestion in taosExplorer, application write configuration, and target queries. Authorized personnel perform source and application cutover.

taosX does not automatically rewrite all InfluxQL queries as TDengine SQL.

1. Choose the Migration Path and Prerequisites​

The recommended sequence is: inventory and trial migration → protect incremental data from boundary T0 → backfill history → catch up and verify → gradually switch queries → observe and decommission the old link. T0 is the business timestamp dividing history from incremental data, not the time Create Task is clicked.

Target deploymentHistorical migrationNew data writesRelationship to this page
TDengine TSDB EnterpriseAn InfluxDB ingestion task in taosExplorer, read by taosX, with an optional agentApplication dual writes, collector dual outputs, or a verified continuous-read task; applications can write Line Protocol through taosAdapterThe main path on this page. See InfluxDB for specific ingestion fields.
TDengine TSDB-OSSExport Line Protocol from the source and import batches through a self-hosted taosAdapterThe InfluxDB v1 write endpoint of a self-hosted taosAdaptertaosX does not actively read the source. Use the open-source branch below.
TDengine CloudA Cloud InfluxDB data source and connection agentCloud Line Protocol endpoint and Cloud TokenA separate cloud-service entry point. Use the versions and configuration in Cloud InfluxDB Data Source.

All three share the principles of inventory, model confirmation, and business verification, but differ in authentication, deployment, and reading methods. Do not use a Cloud Token as a self-hosted TDengine identity. Do not treat taosAdapter as a migration program that actively reads source InfluxDB data.

1.1 Source Inventory​

Have the source administrator and application owner jointly complete the migration inventory. Save original results for critical reports and alarm queries.

ItemInformation to record
Data scopeDatabases, retention policies, Measurements, earliest and latest timestamps, historical volume, daily increments, and T0
Data modelTags/fields, actual types, nulls, tag cardinality, and conflicting types for same-named fields
Time semanticsWrite precision, time zones, out-of-order and late-arrival ranges; use UTC half-open windows, inclusive at the start and exclusive at the end
Write pathApplications and collectors, batching and retries, persistent queues, authentication, and dual-write feasibility
Query pathInfluxQL, reports, alarms, APIs, latest values, and missing-window handling
Source exportWhether the query API is accessible, Line Protocol can be exported directly, or a provider migration tool is required
Implementation conditionsActual read host, least-privilege source and target identities, available space, locations for logs and failed batches, and rollback owner

Start with a short window for one Measurement. Include the tags, numeric and string fields, nulls, and high-precision timestamps actually used. Perform network checks on the taosX host or selected taosX-Agent host. Connectivity from the browser host does not replace this check.

1.2 Target Preparation​

Have an authorized TDengine TSDB administrator create a separate nanosecond-precision database in the taosExplorer Data Browser or taos CLI. If that database name already exists, choose another rather than overwrite it:

CREATE DATABASE migration_db PRECISION 'ns';

Authorize the migration identity and application identity separately. Confirm that retention covers the historical range. Reserve space for source files, failed batches, task state, and verification results. Complete a history, incremental-data, query, and rollback check in a separate test database before expanding to the business scope.

2. Confirm Consistent Historical and Real-Time Models​

When using the taosAdapter Line Protocol endpoint, the default model is as follows. This table does not define universal defaults for all taosX import methods.

Line Protocol contentTarget model
MeasurementSupertable name
tag key/valueTag columns; tag values are treated as NCHAR
field key/valueRegular columns; suffixes or quotation marks determine types
timestampTimestamp primary key, _ts unless a different name is configured
Measurement and tag setChild table; if no child-table name is specified, a hash name is calculated from the name and sorted tags

For example:

cpu,host=server01,region=cn-beijing usage=42.5,load=2i,status="ok" 1795132800000000000

This line represents UTC 2026-11-20T00:00:00Z. usage is floating-point, load is an integer, and status is a string. If the date is outside the test database's retention period, use a timestamp within retention and adjust the queries below accordingly.

warning

The taosX InfluxDB task and taosAdapter Line Protocol writes do not necessarily use the same default child-table naming scheme. For example, an InfluxDB task can concatenate the Measurement and sorted tag values, whereas schemaless writes use hash names by default. Mixing them directly may create two sets of tables. Successful writes through both paths do not prove historical and real-time continuity. First test both paths with the same tag set. Confirm actual table names, primary-key names and precision, fields, and tag types. Unify them under the confirmed naming and mapping plan before enabling dual writes.

Run these structure checks in the taosExplorer Data Browser or taos CLI and record the actual generated child-table names:

SHOW migration_db.STABLES;
SHOW migration_db.TABLES;
DESCRIBE migration_db.cpu;
SHOW CREATE STABLE migration_db.cpu;

If cpu was not generated, first check the actual Measurement and task scope. Do not create an extra same-named table with a different schema just to make the query succeed. Type conflicts between regular columns and tags require explicit conversion or separation; automatic column addition cannot resolve them. Schemaless writes can add columns but do not automatically delete existing ones. Omitted fields may produce NULL. Keep case and dot normalization consistent. For limits such as total row and tag length, see Schemaless Writing.

3. Protect Incremental Data from T0​

A historical export or a single bounded read does not protect new data generated during migration. Have the application owner choose an observable incremental path:

  • Application dual writes: Record acknowledgments, failures, and retries separately for both sides. Put unacknowledged data in a persistent queue. One successful call does not mean both sides succeeded.
  • Collector dual outputs: Observe delay and failures separately for both outputs. Confirm that blocking one side does not silently discard data on the other.
  • Continuous reading: Use an InfluxDB ingestion task with no end time. Set the delay according to the source's late-arrival range, and check historical changes behind the read cursor. Do not claim that all late records will automatically be revisited.

Record the time zone and precision of T0, link startup state, and the first record verifiable on both sides. The business inventory divides history and incremental data at T0, but actual read end boundaries must be checked for the source mode. For overlaps, record deduplication and same-primary-key update policies. Adjacent values in time fields alone do not prove two tasks have mutually exclusive ranges. Do not start a lengthy full backfill until the protection link passes verification.

4. Backfill History​

4.1 Enterprise Main Path​

Create a task and complete the prerequisites in InfluxDB: select the target database, source 1.x authentication, agent, and source objects; check connectivity and fetch the schema. Initially select only one Measurement. Specify start and end timestamps and the page's time zone. Read with a small per-read window in minutes. The end time must not exceed the agreed historical boundary.

warning

The ordinary 1.x tag set mode includes the end timestamp. A historical task with end=T0 reads records exactly at T0 again. Register these as boundary samples overlapping incremental data, and verify models, same-primary-key writes, and retries across the two entry points. Do not call the ranges completely exclusive. The 1.x scan mode has a different end boundary; see InfluxDB Window Verification. Do not arbitrarily subtract one second from the endpoint to eliminate overlap; that can miss nanosecond-precision records.

After submission, observe task activity, errors, read progress, and actual target data separately. If reads take too long or source load is excessive, reduce the window first, then assess concurrency. Do not simply duplicate more tasks. Maintain a Measurement/time-range inventory. For each window, record source and target counts, sampled values, failed batches, and the confirming person. After resuming the original task, recheck the interrupted window. A progress file does not prove all windows are complete.

4.2 Open-Source Export Branch​

If the source provides a local data directory, use an export tool matching its InfluxDB version and verify a small window first. If a managed service does not expose the data directory, use the provider's approved migration method, such as the backup, relay restoration, and Line Protocol export workflow in Alibaba Cloud TSDB for InfluxDB Migration Instructions. Provider ports, permissions, and resource requirements follow provider documentation; they are not taosX dependencies.

Split files by Measurement and time window, retaining the originals and their ranges. Import batches through taosAdapter and record acknowledgments and failure reasons for each batch. A multiline request can partially succeed. Do not replay all acknowledged batches because one request fails. After fixing the issue, retry only confirmed failed ranges and keep incremental protection running. See InfluxDB v1 Data Ingestion for API parameters.

4.3 Cloud Branch​

Deploy the Cloud agent in a network that can reach the source InfluxDB. Select a nanosecond target database and a source read-only identity, then configure objects, times, read windows, and delay as described in InfluxDB Data Source. Cloud writes use a separate endpoint and Cloud Token; see Cloud Line Protocol. Supply tokens through secret management or runtime injection, not in source code or logs. Self-hosted systems do not use these credentials.

5. Verify the Application Write Endpoint​

The following exercise is only for an isolated test environment. taosAdapter and the command process must run in the same host environment: port 6041, an existing target database migration_db, and the unchanged default demo account root/taosdata. In production, use the actual HTTPS address and least-privilege credentials. Do not copy localhost unchanged across Windows, WSL, and containers.

The authentication entry points for self-hosted taosAdapter are listed below. This two-platform exercise uses Basic and does not require creating a Token first. Choose other methods according to the actual delivery and identity policy. Do not mix multiple authentication entry points in one request.

Authentication methodWhere usedNotes
TDengine username and passwordAuthorization: Basic ..., or the client's Basic optionNot the source InfluxDB identity. Basic encoding is not encryption; use HTTPS in production.
URL username and passwordQuery parameters u, pUse an actual TDengine identity and encode it correctly for a URL. It may leak into proxy access logs and is not the preferred option for new applications.
TDengine Bearer TokenPassed in Authorization: Bearer <token> in EnterpriseManaged by the TDengine TSDB administrator as described in Authentication. It is neither an InfluxDB Token nor the Cloud query parameter token. When using this entry point, omit the token URL parameter; otherwise the Bearer parsing branch is not used.

Run in Bash on the application's Linux test host. The example requires curl v7.76 or later with --fail-with-body, which returns a nonzero exit code on HTTP errors while preserving the response body:

curl --fail-with-body --request POST \
'http://localhost:6041/influxdb/v1/write?db=migration_db&precision=ns' \
--user 'root:taosdata' \
--data-binary 'cpu,host=server01,region=cn-beijing usage=42.5,load=2i,status="ok" 1795132800000000000'

After HTTP success, still check the data in the taosExplorer Data Browser or taos CLI. The following query assumes the actual primary key is _ts and field types match the above. If trial migration generated another primary-key name, substitute the real structure rather than create a second model:

SELECT tbname, _ts, usage, load, status, host, region
FROM migration_db.cpu
WHERE _ts = '2026-11-20T00:00:00.000000000Z'
AND host = 'server01' AND region = 'cn-beijing';

Expect the specified timestamp, 42.5, 2, ok, and corresponding tags. Then compare tbname with a historical trial-migration row. If data for the same device lands in different child tables, correct the naming plan before expanding dual writes. This step verifies only the application-to-target write endpoint; it does not prove that source InfluxDB history has been fully migrated.

6. Adapt and Regression-Test Queries​

taosX does not rewrite application queries. Have the application owner save pairs of original InfluxQL and TDengine SQL and compare them item by item using data from the same window. These examples use a separate migration_query_demo.cpu, primary key _ts, and UTC. Run each in the corresponding product's query client; do not send InfluxQL directly to taos CLI.

Query intentTDengine syntax and checks
Time and tag filteringWHERE _ts >= ... AND _ts < ... AND host = 'server01'; align precision and boundaries
MEAN, MAX, COUNTAVG, MAX, COUNT; align null handling and what is counted
GROUP BY time(1m)INTERVAL(1m); check window boundaries
Group by tagChoose PARTITION BY or GROUP BY by semantics, not by keyword replacement alone
Latest valueLAST(expr) is the last non-null value; LAST_ROW(*) is the latest complete row
Missing windowsFILL(NULL/PREV/LINEAR); verify the meanings of gaps, previous values, and interpolation separately

6.1 Prepare the Same Small Dataset on Both Sides​

This section uses a separate migration_query_demo; it does not append test data to the migration database above. First confirm that the same-named databases on both sides are not used for business, and have an authorized administrator create them. Run the following in the source InfluxDB 1.x influx shell. Numeric timestamps are in nanoseconds:

CREATE DATABASE migration_query_demo
USE migration_query_demo
INSERT cpu,host=server01,region=cn-beijing usage=42.5,load=2i,status="ok" 1795132800000000000
INSERT cpu,host=server01,region=cn-beijing usage=57.5,load=4i,status="ok" 1795132830000000000
INSERT cpu,host=server01,region=cn-beijing usage=70.0,load=3i,status="ok" 1795132920000000000
INSERT cpu,host=server01,region=cn-beijing load=5i,status="idle" 1795132980000000000
INSERT cpu,host=server02,region=cn-shanghai usage=20.0,load=1i,status="ok" 1795132815000000000
INSERT cpu,host=server02,region=cn-shanghai usage=30.0,load=2i,status="ok" 1795132920000000000

On the target, explicitly model and write the same dataset in the taosExplorer Data Browser or taos CLI. This query-regression dataset does not replace verification of historical migration or Line Protocol automatic modeling:

CREATE DATABASE migration_query_demo PRECISION 'ns';
CREATE STABLE migration_query_demo.cpu
(_ts TIMESTAMP, usage DOUBLE, load BIGINT, status NCHAR(16))
TAGS (host NCHAR(32), region NCHAR(32));
INSERT INTO migration_query_demo.cpu_server01 USING migration_query_demo.cpu
TAGS ('server01', 'cn-beijing') VALUES
('2026-11-20T00:00:00Z', 42.5, 2, 'ok')
('2026-11-20T00:00:30Z', 57.5, 4, 'ok')
('2026-11-20T00:02:00Z', 70.0, 3, 'ok')
('2026-11-20T00:03:00Z', NULL, 5, 'idle');
INSERT INTO migration_query_demo.cpu_server02 USING migration_query_demo.cpu
TAGS ('server02', 'cn-shanghai') VALUES
('2026-11-20T00:00:15Z', 20.0, 1, 'ok')
('2026-11-20T00:02:00Z', 30.0, 2, 'ok');

Keep USE migration_query_demo active before each source query. First query the six raw records and tags on both sides. Confirm that server01 has no record at 00:01 and only usage is missing at 00:03, then run the comparisons below. Target retention must cover the sample date. If changing the date, update nanosecond values, UTC literals, and all query boundaries together.

6.2 Time Windows and Tags​

Source InfluxQL:

SELECT MEAN("usage") FROM "cpu"
WHERE time >= '2026-11-20T00:00:00Z' AND time < '2026-11-20T00:02:00Z'
AND "host" = 'server01'
GROUP BY time(1m), "host"

Target SQL, run in the taosExplorer Data Browser or taos CLI:

SELECT _wstart AS window_start, host, AVG(usage) AS avg_usage
FROM migration_query_demo.cpu
WHERE _ts >= '2026-11-20T00:00:00Z' AND _ts < '2026-11-20T00:02:00Z'
AND host = 'server01'
PARTITION BY host INTERVAL(1m);

Compare window starts and averages. The server01 average for the 00:00 window should be 50; 00:01 has no valid samples. Default gap display may differ. Do not treat the number of empty-window rows as the raw sample count.

6.3 Aggregate by Tag or Table​

Source InfluxQL, grouped by region:

SELECT MAX("usage"), COUNT("usage") FROM "cpu"
WHERE time >= '2026-11-20T00:00:00Z' AND time < '2026-11-21T00:00:00Z'
GROUP BY "region"

Target SQL:

SELECT region, MAX(usage) AS max_usage, COUNT(usage) AS sample_count
FROM migration_query_demo.cpu
WHERE _ts >= '2026-11-20T00:00:00Z' AND _ts < '2026-11-21T00:00:00Z'
PARTITION BY region;

Group source InfluxQL by the complete tag set, for comparison with this example's model in which each tag set corresponds to one child table:

SELECT MEAN("usage") FROM "cpu"
WHERE time >= '2026-11-20T00:00:00Z' AND time < '2026-11-20T01:00:00Z'
GROUP BY time(1h), "host", "region"

On the target, use PARTITION BY tbname for per-table statistics. Match actual child tables using host/region; group names need not match between sides. This correspondence holds only after confirming that one complete tag set maps to exactly one target child table:

SELECT tbname, _wstart AS window_start, AVG(usage) AS avg_usage
FROM migration_query_demo.cpu
WHERE _ts >= '2026-11-20T00:00:00Z' AND _ts < '2026-11-20T01:00:00Z'
PARTITION BY tbname INTERVAL(1h);

6.4 Latest Value and Latest Complete Row​

Source InfluxQL queries the latest record and last non-null value separately. In this example, server01 has only one tag set:

SELECT * FROM "cpu" WHERE "host" = 'server01' ORDER BY time DESC LIMIT 1
SELECT LAST("usage") FROM "cpu" WHERE "host" = 'server01'

Target SQL:

SELECT LAST_ROW(*) FROM migration_query_demo.cpu WHERE host = 'server01';
SELECT LAST(usage) FROM migration_query_demo.cpu WHERE host = 'server01';

Check with this example: the latest complete row is at 00:03 with null usage; LAST(usage) is 70 at 00:02. When a complete record from one timestamp is required, do not assemble a “latest row” from each column's last non-null value.

6.5 Recent Raw Records​

Source InfluxQL:

SELECT "usage", "load" FROM "cpu"
WHERE "host" = 'server01' ORDER BY time DESC LIMIT 10

Target SQL:

SELECT _ts, usage, load FROM migration_query_demo.cpu
WHERE host = 'server01' ORDER BY _ts DESC LIMIT 10;

Check sorting and tied timestamps. With PARTITION BY, LIMIT limits results per partition, not the “global first ten records.”

6.6 Missing Values in Windows​

Source InfluxQL:

SELECT MEAN("usage") FROM "cpu"
WHERE time >= '2026-11-20T00:00:00Z' AND time < '2026-11-20T01:00:00Z'
AND "host" = 'server01'
GROUP BY time(1m) fill(previous)

Target SQL, using the same one-hour window and gap samples:

SELECT _wstart AS window_start, AVG(usage) AS avg_usage
FROM migration_query_demo.cpu
WHERE _ts >= '2026-11-20T00:00:00Z' AND _ts < '2026-11-20T01:00:00Z'
AND host = 'server01'
INTERVAL(1m) FILL(PREV);

Previous-value filling and linear interpolation change dashboards and downstream calculations. Identical names do not establish complete equivalence. See Data Query and Functions for full semantics.

7. Catch Up and Cut Over the Workload​

Verification itemChecks and pass criteria
Time boundariesCompare earliest and latest window timestamps by Measurement/tag set, covering T0 and the final cutover window.
CountsCompare the same window, fields, and deduplication criteria. Similar database-wide totals are insufficient.
Content and modelTime precision, values, tags, nulls, types, and child-table assignments agree.
Aggregates and queriesCompare COUNT/MIN/MAX/AVG, latest values, missing windows, reports, and alarms.
Write qualityAcknowledgments, failed retries, and unacknowledged queues on both sides are explainable. Delay meets the agreed business threshold.
Rollback materialsThe old system remains usable, target-only data has a preservation method, and the owner and execution window are confirmed.

Authorized personnel complete these steps in order:

  1. Confirm that the historical window inventory has no unresolved differences and incremental data has caught up to the recorded timestamp.
  2. Freeze old writes or stop the old entry point according to the cutover plan, and record the last acknowledged record. Do not simultaneously stop a protection link still needed for replay.
  3. Wait for the dual-write queue or continuous task to finish the final window. Check late arrivals and failed batches.
  4. Verify data in the final window, then gradually switch a small portion of read requests to TDengine SQL.
  5. Compare trends, aggregates, time zones, and alarms. Expand only after stability, retaining an observation period and the old link.
  6. Obtain separate approval to decommission the source after business verification. Do not stop the database automatically because a migration task completes.

8. Troubleshooting and Rollback​

SymptomCheck order and next action
History is correct but recent data is missingCheck T0, the first acknowledged incremental record, failed queues, source retention, and late-arrival windows, then identify backfillable ranges.
Dual writes create two sets of tablesCompare table names, tags, and primary keys at both entry points. Stop scope expansion. Do not merge or delete tables without approval.
Excessive source query loadReduce the per-read window, check concurrency and read duration, and retain an inventory of unfinished windows.
Field type conflictRetain failed batches and check source type distribution and target structure. Confirm conversion before retrying only affected ranges.
Similar point counts but different dashboardsCheck precision, nulls, aggregate grouping, windows, time zones, and latest-value semantics.
Only the new system receives writes after cutoverFirst protect target-only data. Assess backfilling it into the old system or retaining new writes with old reads. Simply pointing back to the old database does not establish zero loss.

If critical differences appear or delay exceeds the agreed threshold, stop expanding cutover and have the responsible owner roll back reads and writes according to the approved plan. Retain both systems, original files, failed batches, logs, and verification results. Catch up and verify again before another round. Do not conceal problems by deleting the target database.

9. Extensions After Stabilization​

After the original workload cutover is complete, separately assess precomputation, downstream consumption, and combined queries. Do not launch them with the base cutover. The three independent examples below retain the same CPU scenario; they are not migration steps automatically performed by taosX. Before an authorized TDengine TSDB administrator runs them in the taosExplorer Data Browser or taos CLI, confirm an isolated test database, actual table structures, and unused object names, and approve the resources and maintenance scope for new objects. Do not run all three SQL blocks against a business database without review.

Precompute CPU averages by minute

The primary timestamp and usage in migration_db.cpu must have passed verification above, and cluster stream-processing deployment and permissions must meet Stream Processing requirements. The following creates a continuously computing stream and a result table to aggregate CPU values from this supertable in one-minute windows. Because it does not group by host, the result is not an average for each individual host.

CREATE STREAM migration_db.cpu_usage_1m_stream
INTERVAL(1m) SLIDING(1m)
FROM migration_db.cpu
INTO migration_db.cpu_usage_1m
AS
SELECT _twstart AS ts, AVG(usage) AS avg_usage
FROM %%trows;

Follow the stream-processing documentation to check stream status, trigger windows, and actual result objects. Run AVG(usage) on the source table for the same complete window and compare window starts and averages. Successful creation does not prove that all history has been recomputed or that a new window has completed. Wait for and verify actual trigger results from approved test data. Disabling, deletion, and result retention follow the stream's separate maintenance plan.

Provide CPU records for downstream subscription

Source WAL retention and the downstream consumption plan must be confirmed, migration_db.cpu must contain _ts, usage, and status, and the topic name must be unused. Create a query topic in the taosExplorer Data Browser or taos CLI:

CREATE TOPIC cpu_realtime_topic AS
SELECT tbname, _ts, usage, status FROM migration_db.cpu;

This SQL only creates a topic. It does not automatically start a consumer or send data to an arbitrary downstream system. Configure a consumer and a separate consumer group according to Data Subscription. Use a known new record to check table name, timestamp, value, status, and committed position. Query topics do not support aggregates or time windows. To subscribe to minute aggregates, first write stream-processing results to a table and create a topic for the actual result table. Do not use the preceding AVG directly in a topic query.

Combine CPU and environmental metrics in a query

Actual CPU and environmental child tables for the same device must already exist. This example assumes migration_db.cpu_server01 (usage DOUBLE) and migration_db.env_server01 (temperature FLOAT), with matching time precision and business-time semantics. The earlier schemaless writes may generate hashed child-table names. First check with SHOW migration_db.TABLES and DESCRIBE and substitute both actual sources. Do not copy nonexistent table names unchanged.

CREATE VTABLE migration_db.device_overview (
ts TIMESTAMP,
cpu_usage DOUBLE FROM migration_db.cpu_server01.usage,
temperature FLOAT FROM migration_db.env_server01.temperature
);
SELECT ts, cpu_usage, temperature
FROM migration_db.device_overview ORDER BY ts DESC LIMIT 10;

A virtual table does not store separate data; it combines query results by source timestamp. Verify timestamps present in both sources and timestamps present in only one. The former can combine values; for the latter, the missing column is NULL. There is no automatic interpolation or filling a source timestamp with the other source's latest value. See Virtual Tables for source physical-table and column permissions, types, maintenance constraints, and full syntax.

Each extension needs its own functional tests, performance baseline, and disabling/rollback plan. Migration verification does not replace extension verification. Do not delete original migration data to clean up experimental results.