# Move databse to a new server - tutorial?

**URL:** <https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808>\
**Category:** InfluxDB 1\
**Created:** [July 18, 2021, 6:39pm UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808 "2021-07-18T18:39:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinc](https://avatars.discourse-cdn.com/v4/letter/v/e9c0ed/32.png) [@vinc](https://community.influxdata.com/u/vinc)\
**Post date:** [July 18, 2021, 6:39pm UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/1 "2021-07-18T18:39:58Z")

</div>

Hello  
is there a step by step tutorial - to move influxDB’s from a Raspberry Pi to a VM?  
both have the same influxDB 1.8

have a nice day  
vinc

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.influxdata.com/u/Pooh)\
**Post date:** [July 18, 2021, 6:53pm UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/2 "2021-07-18T18:53:20Z")

</div>

I would use

> **[Back up and restore data in InfluxDB v1.8 | InfluxDB OSS 1.8 Documentation](https://docs.influxdata.com/influxdb/v1.8/administration/backup_and_restore/)**
>
> To prevent unexpected data loss, back up and restore InfluxDB OSS instances.

Antony.

---

<div class="post-metadata">

**Author:** ![vinc](https://avatars.discourse-cdn.com/v4/letter/v/e9c0ed/32.png) [@vinc](https://community.influxdata.com/u/vinc)\
**Post date:** [July 18, 2021, 9:18pm UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/3 "2021-07-18T21:18:24Z")

</div>

@Pooh Antony Merci  
the link is good - just not sure i understood everything right.  
it’s just as soon it it is done i have to change node Red too. so i don’t should lose to much time with try and erroe

have a nice day  
vinc

---

<div class="post-metadata">

**Author:** ![JeremySTX](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jeremystx/32/688_2.png) [@JeremySTX](https://community.influxdata.com/u/JeremySTX)\
**Post date:** [July 27, 2021, 11:02am UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/4 "2021-07-27T11:02:38Z")

</div>

Hi,

I have the same issue but of course slightly different.  
My problem is the existing database is InfluxDB 1.2.4 (yes, very old) and I need to move about 250GB of data to the new server (InfluxDB 1.8.6).

The `influxdb.conf` file on the old server does not mention port 8088.  
However I did see this:

```auto
$ influxd backup -help
Downloads a snapshot of a data node and saves it to disk.

Usage: influxd backup [flags] PATH

    -host <host:port>
            The host to connect to snapshot. Defaults to 127.0.0.1:8088.
    -database <name>
            The database to backup.
    -retention <name>
            Optional. The retention policy to backup.
    -shard <id>
            Optional. The shard id to backup. If specified, retention is required.
    -since <2015-12-24T08:12:23>
            Optional. Do an incremental backup since the passed in RFC3339
            formatted time.

backup: flag: help requested
$

```

It mentions port 8088 there, but it’s not clear to me how that option is to be used.

Thanks.  
Jeremy Begg

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [July 30, 2021, 5:17pm UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/5 "2021-07-30T17:17:50Z")

</div>

Hello @JeremySTX,  
**To enable the port for the backup and restore service:**

1. At the root level of the InfluxDB config file ( `influxdb.conf` ), uncomment the [`bind-address` configuration setting](https://docs.influxdata.com/influxdb/v1.8/administration/config#bind-address-127-0-0-1-8088) on the remote node.
2. Update the `bind-address` value to `<remote-node-IP>:8088`
3. Provide the IP address and port to the `-host` parameter when you run commands.

If you want to back up everything you can use:

```auto
influxd backup -portable <path-to-backup>

```

As per:

> **[Back up and restore data in InfluxDB v1.8 | InfluxDB OSS 1.8 Documentation](https://docs.influxdata.com/influxdb/v1.8/administration/backup_and_restore/#backup-examples)**
>
> To prevent unexpected data loss, back up and restore InfluxDB OSS instances.

And to restore everything:

```auto
influxd restore -portable path-to-backup

```

As per:

> **[Back up and restore data in InfluxDB v1.8 | InfluxDB OSS 1.8 Documentation](https://docs.influxdata.com/influxdb/v1.8/administration/backup_and_restore/#restore-examples)**
>
> To prevent unexpected data loss, back up and restore InfluxDB OSS instances.

---

<div class="post-metadata">

**Author:** ![JeremySTX](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jeremystx/32/688_2.png) [@JeremySTX](https://community.influxdata.com/u/JeremySTX)\
**Post date:** [July 31, 2021, 6:21am UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/6 "2021-07-31T06:21:14Z")

</div>

Hi,

Thanks for responding and for the documentation references. After a little mucking around I got the backup command running, but it doesn’t manage to save any data.

I think there must have been a change to the backup protocol between version 1.2.4 (the system where the data is) and version 1.8.6 (the system I want to move the data to). Here’s what hapens:

On the InfluxDB 1.8.6 system:

```auto
$ influxd backup -database solarmon_30min -host REDACTED:8088 /idb_backups/30min_31-Jul-2021/
2021/07/31 15:41:53 backing up metastore to /idb_backups/30min_31-Jul-2021/meta.00
2021/07/31 15:41:53 Download shard 0 failed copy backup to file: err=<nil>, n=0. Waiting 2s and retrying (0)...
2021/07/31 15:41:55 Download shard 0 failed copy backup to file: err=<nil>, n=0. Waiting 2s and retrying (1)...
2021/07/31 15:41:57 Download shard 0 failed copy backup to file: err=<nil>, n=0. Waiting 2s and retrying (2)...
...etc...

```

On the InfluxDB 1.2.4 system, the following is displayed in `/var/log/syslog`:

```auto
Jul 31 15:41:53 sol influxd[24619]: [I] 2021-07-31T06:11:53Z read request: invalid character '\x01' looking for beginning of value service=snapshot
Jul 31 15:41:55 sol influxd[24619]: [I] 2021-07-31T06:11:55Z read request: invalid character '\x01' looking for beginning of value service=snapshot
Jul 31 15:41:57 sol influxd[24619]: [I] 2021-07-31T06:11:57Z read request: invalid character '\x01' looking for beginning of value service=snapshot
...etc...

```

I tried it with and without the `-portable` option and it didn’t make any difference.

Thanks,  
Jeremy Begg

---

<div class="post-metadata">

**Author:** ![Evert\_Hoegee](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/evert_hoegee/32/14928_2.png) [@Evert\_Hoegee](https://community.influxdata.com/u/Evert_Hoegee)\
**Post date:** [January 17, 2024, 5:58am UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/7 "2024-01-17T05:58:59Z")

</div>

Hi I head a faulty installation where the backup command wasn’t working.  
So needed to migrate a influx 1.7 DB.

So to migrate it, create a new server / Virtual machine. But I think this will also work with a container.

- Stop the services on the source DB.

- Copy the var/lib/influxdb folder to a backup location. (Including all the subfolders and files)

- On the new server, install influx 1.7, create an empty DB with the same name.

- Create a user so you can access the data remotely.

- Copy BACKUP/influxdb/data/ “DATABASE” → var/lib/influxdb/data/

- On the destination server delete the var/lib/influxdb/meta/“File” and copy the one from your backup to that location.

- Add the permissions so influx can read the new files:  
`cd var/lib/influxdb `  
`chmod -R 777 *`

- start the influx db services on the new server

And in my case I could access the data and head a working influx db instance.  
As I’m not a Linux master I just use the chmod 777 command to get it working. But if you plan to keep using this server please make sure that you change this back so only influx db has richts on the files.

Hope someone can use this information 🙂

---

<div class="post-metadata">

**Author:** ![Evert\_Hoegee](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/evert_hoegee/32/14928_2.png) [@Evert\_Hoegee](https://community.influxdata.com/u/Evert_Hoegee)\
**Post date:** [January 17, 2024, 6:03am UTC](https://community.influxdata.com/t/move-databse-to-a-new-server-tutorial/20808/8 "2024-01-17T06:03:10Z")

</div>

Not sure if it is still running, I hope not! but bellow is how I migrated data with only the DB files left.
