# Copy data between databases on different hosts - how-to/where to start?

**URL:** <https://community.influxdata.com/t/copy-data-between-databases-on-different-hosts-how-to-where-to-start/17293>\
**Category:** Welcome & Getting Started\
**Created:** [December 19, 2020, 4:02pm UTC](https://community.influxdata.com/t/copy-data-between-databases-on-different-hosts-how-to-where-to-start/17293 "2020-12-19T16:02:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KlingsporC](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@KlingsporC](https://community.influxdata.com/u/KlingsporC)\
**Post date:** [December 19, 2020, 4:02pm UTC](https://community.influxdata.com/t/copy-data-between-databases-on-different-hosts-how-to-where-to-start/17293/1 "2020-12-19T16:02:06Z")

</div>

Hi, total rookie on InfluxDB and first post here, but with some experience with traditional SQL-databases. I need some advice on how to move forward.

I installed an influx database (1.8.3) on host A to persist measurements from OpenHAB and it worked just fine out of the box. Since A is a Raspberry Pi I had problems using the rendering service in Grafana so I decided to install a new InfluxDB (2.0.0) (and Grafana) to docker containers on a separate Intel NUC with Ubuntu 20.04 (host B). When everything was tested, I decided to shift my OpenHAB persistance service to use Influx on host B and it worked immediately - all measurements are now being stored in the new database on host B.

The reason I did it like this and not by using a backup/restore from A to B was that I didn’t want to end up with a “gap” in my measurements while doing the backup/restore.

So, now I have an old database with a number of tables containing my historical data that I want to “copy” to my new database. Is there an easy way to do something like:

```
select
  col_1, col_2
from
  host_A:database_1.table_a
into
  host_B:database_1.table_a.col_1,
  host_B:database_1.table_a.col_2

```

Can someone guide me in the right direction and/or tell me where to start in the documentation?

Many thanks in advance!

---

<div class="post-metadata">

**Author:** ![FixTestRepeat](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/fixtestrepeat/32/5208_2.png) [@FixTestRepeat](https://community.influxdata.com/u/FixTestRepeat)\
**Post date:** [December 27, 2020, 9:17am UTC](https://community.influxdata.com/t/copy-data-between-databases-on-different-hosts-how-to-where-to-start/17293/2 "2020-12-27T09:17:23Z")

</div>

Sure, take a look here.

> **[Upgrade from InfluxDB 1.x to 2.6 | InfluxDB OSS 2.6 Documentation](https://docs.influxdata.com/influxdb/v2.0/upgrade/v1-to-v2/)**
>
> Explore different methods for upgrading from InfluxDB 1.x to InfluxDB 2.6 and choose the best one for your use case.

---

<div class="post-metadata">

**Author:** ![KlingsporC](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@KlingsporC](https://community.influxdata.com/u/KlingsporC)\
**Post date:** [December 28, 2020, 9:19am UTC](https://community.influxdata.com/t/copy-data-between-databases-on-different-hosts-how-to-where-to-start/17293/3 "2020-12-28T09:19:44Z")

</div>

Thanks for your reply!

Since both databases were up and running I decided to go for a solution exporting data to csv-files and then use telegraf to import the old time series into the new database. I felt it gave me more control over the process and and let me collect measurements continuously and avoid any gaps n the series during the migration.
