--- title: Migrate InfluxDB OSS instances to InfluxDB Enterprise clusters description: > Migrate a running instance of InfluxDB open source (OSS) to an InfluxDB Enterprise cluster. aliases: - /enterprise/v1.10/guides/migration/ menu: enterprise_influxdb_v1: name: Migrate InfluxDB OSS to Enterprise weight: 10 parent: Guides --- Migrate a running instance of InfluxDB open source (OSS) to an InfluxDB Enterprise cluster. {{% note %}} Migration transfers all users from the OSS instance to the InfluxDB Enterprise cluster. {{% /note %}} ## Migrate an OSS instance to InfluxDB Enterprise Complete the following tasks to migrate data from OSS to an InfluxDB Enterprise cluster without downtime or missing data. 1. Upgrade InfluxDB OSS and InfluxDB Enterprise to the latest stable versions. - [Upgrade InfluxDB OSS](/influxdb/v1/administration/upgrading/) - [Upgrade InfluxDB Enterprise](/enterprise_influxdb/v1/administration/upgrading/) 2. On each meta node and each data node, add the IP and hostname of your OSS instance to the `/etc/hosts` file. This will allow the nodes to communicate with the OSS instance. 3. On the OSS instance, take a portable backup from OSS using the **influxd backup** command with the `-portable` flag: ```sh influxd backup -portable -host :8088 /tmp/mysnapshot ``` Note the current date and time when you take the backup. For more information, see [influxd backup](/influxdb/v1/tools/influxd/backup/). 4. Restore the backup on the cluster by running the following: ```sh influxd-ctl restore ``` > **Note:** InfluxDB Enterprise uses the **influxd-ctl utility** to back up and restore data. For more information, see [influxd-ctl](/enterprise_influxdb/v1/tools/influxd-ctl) and [`restore`](/enterprise_influxdb/v1/administration/backup-and-restore/#restore). 5. To avoid data loss, dual write to both OSS and Enterprise while completing the remaining steps. This keeps the OSS and cluster active for testing and acceptance work. For more information, see [Write data with the InfluxDB API](/enterprise_influxdb/v1/guides/write_data/). 6. [Export data from OSS](/enterprise_influxdb/v1/administration/backup-and-restore/#exporting-data) from the time the backup was taken to the time the dual write started. For example, if you take the backup on `2020-07-19T00:00:00.000Z`, and started writing data to Enterprise at `2020-07-19T23:59:59.999Z`, you would run the following command: ```sh influx_inspect export -compress -start 2020-07-19T00:00:00.000Z -end 2020-07-19T23:59:59.999Z` ``` For more information, see [`-export`](/enterprise_influxdb/v1/tools/influx_inspect#export). 7. [Import data into Enterprise](/enterprise_influxdb/v1/administration/backup-and-restore/#importing-data). 8. Verify data is successfully migrated to your Enterprise cluster. See: - [Query data with the InfluxDB API](/enterprise_influxdb/v1/guides/query_data/) - [View data in Chronograf](/chronograf/v1/) Next, stop writes to OSS instance, and remove it. #### Stop writes and remove OSS 1. Stop all writes to the InfluxDB OSS instance. 2. Stop the `influxdb` service on the InfluxDB OSS instance server. {{< code-tabs-wrapper >}} {{% code-tabs %}} [sysvinit](#) [systemd](#) {{% /code-tabs %}} {{% code-tab-content %}} ```bash sudo service influxdb stop ``` {{% /code-tab-content %}} {{% code-tab-content %}} ```bash sudo systemctl stop influxdb ``` {{% /code-tab-content %}} {{< /code-tabs-wrapper >}} 3. Double check that the service is stopped. The following command should return nothing: ```bash ps ax | grep influxd ``` 4. Remove the InfluxDB OSS package. {{< code-tabs-wrapper >}} {{% code-tabs %}} [Debian & Ubuntu](#) [RHEL & CentOS](#) {{% /code-tabs %}} {{% code-tab-content %}} ```bash sudo apt-get remove influxdb ``` {{% /code-tab-content %}} {{% code-tab-content %}} ```bash sudo yum remove influxdb ``` {{% /code-tab-content %}} {{< /code-tabs-wrapper >}} ## Rebalance the cluster 1. Use the [`ALTER RETENTION POLICY`](/enterprise_influxdb/v1/query_language/manage-database/#modify-retention-policies-with-alter-retention-policy) statement to increase the [replication factor](/enterprise_influxdb/v1/concepts/glossary/#replication-factor) on all existing retention polices to the number of data nodes in your cluster. 2. [Rebalance your cluster manually](/enterprise_influxdb/v1/guides/rebalance/) to meet the desired replication factor for existing shards. 3. If you were using [Chronograf](/chronograf/v1/), add your Enterprise instance as a new data source.