# Migrating, bindings are removed on openhab2 start

**URL:** <https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830>\
**Category:** 1.x Compatibility\
**Created:** [February 1, 2017, 10:55pm UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830 "2017-02-01T22:55:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxplay](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@maxplay](https://community.openhab.org/u/maxplay)\
**Post date:** [February 1, 2017, 10:55pm UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/1 "2017-02-01T22:55:27Z")

</div>

hello everybody, sorry if this is a repeated question but the posts i read didn’t help me out..

i’m migrating from 1.8.3  
my java:

```javascript
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode)

```

briefly, the problem is: When i start openhab2 the logs shows that 3 bindings are being uninstalled, and i really don’t understand why.

This 3 bindings are always uninstalled when i execute service openhab start:

```javascript
2017-02-01 20:09:41.439 [ExtensionEvent] - Extension 'binding-mqttitude1' has been uninstalled.
2017-02-01 20:09:57.243 [ExtensionEvent] - Extension 'binding-mqtt1' has been uninstalled.
2017-02-01 20:10:06.102 [ExtensionEvent] - Extension 'binding-http1' has been uninstalled.

```

Besides that items are removed (events.log shows that)

i really don’t understand what is going on 😥

My installation was like this:

```javascript
sudo apt-get install openhab2
sudo apt-get install openhab2-addons
sudo apt-get install openhab2-addons-legacy

```

i edited the files addons.cfg and runtime.cfg  
didn’t install the Compatibility layer because i don’t think is necessary (?)  
i populated the services/.cfg files that the addons created

my addons.cfg:

```javascript

# The installation package of this openHAB instance
# Note: This is only regarded at the VERY FIRST START of openHAB
# Note: If you want to specify your add-ons yourself through entries below, set the package to "minimal"
# as otherwise your definition might be in conflict with what the installation package defines.
#
# Optional. If not set, the dashboard (https://<yourserver>:8080/) will ask you to choose a package.
#
# Valid options:
# - minimal : Installation only with dashboard, but no UIs or other add-ons. Use this for custom setups.
# - simple : Setup for using openHAB purely through UIs - you need to expect MANY constraints in functionality!
# - standard : Default setup for normal users, best for textual setup
# - expert : Setup for expert users, especially for people migrating from openHAB 1.x
# - demo : A demo setup which includes UIs, a few bindings, config files etc.
#
# See http://docs.openhab.org/configuration/packages.html for a detailed explanation of these packages.
#
package = standard

# Access Remote Add-on Repository
# Defines whether the remote openHAB add-on repository should be used for browsing and installing add-ons.
# This not only makes latest snapshots of add-ons available, it is also required for the installation of
# any legacy 1.x add-on. (default is true)
#
remote = true

# Include legacy 1.x bindings. If set to true, it also allows the installation of 1.x bindings for which there is
# already a 2.x version available (requires remote repo access, see above). (default is false)
#
legacy = true

# A comma-separated list of bindings to install (e.g. "sonos,knx,zwave")
binding = mqtt,http,ntp,mqttitude

# A comma-separated list of UIs to install (e.g. "basic,paper")
ui = basic,paper,classic,habpanel

# A comma-separated list of persistence services to install (e.g. "rrd4j,jpa")
persistence = mysql

# A comma-separated list of actions to install (e.g. "mail,pushover")
action = mail

# A comma-separated list of transformation services to install (e.g. "map,jsonpath")
transformation = map

# A comma-separated list of voice services to install (e.g. "marytts,freetts")
voice =

# A comma-separated list of miscellaneous services to install (e.g. "myopenhab")
misc =

```

firstly i used ‘expert’ then change to ‘standard’…  
i don’t know if it has nothing to do, i suppose not…

for example

1. now the service is running..
2. i have the cfg files populated, in place
3. no bindings
4. $ ssh openhab@localhost -p 8101
5. i install the 3 bindings.

```javascript
feature:install openhab-binding-mqttitude1
feature:install openhab-binding-mqtt1
feature:install openhab-binding-http1

```

then when i start openhab2 the bindings are automatically uninstalled…😫  
openhab.log

```javascript
2017-02-01 20:09:24.297 [INFO] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-02-01 20:09:24.439 [INFO] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-02-01 20:09:24.837 [INFO] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app
2017-02-01 20:09:25.279 [INFO] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-02-01 20:09:32.868 [ERROR] [mqttitude.internal.MqttitudeConsumer] - Unable to calculate relative location for LG_EnCasa as there is no lat/lon configured for 'home'
2017-02-01 20:09:41.432 [INFO] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-mqttitude1'
2017-02-01 20:09:50.393 [INFO] [penhab.io.transport.mqtt.MqttService] - Stopping broker connection 'mosquitto'
2017-02-01 20:09:57.233 [INFO] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-mqtt1'
2017-02-01 20:10:06.099 [INFO] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-http1'
2017-02-01 20:10:07.017 [INFO] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been shut down

```

**Also,** maybe has nothing to do with what i’m saying..when i execute

```javascript
sudo service openhab2 restart

```

it just stops the service and doesn’t start again  
i have to run the same command with ‘start’ to start openhab2

Any help/tip is appreciated!

---

<div class="post-metadata">

**Author:** ![skeksil](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/d6d6ee/32.png) [@skeksil](https://community.openhab.org/u/skeksil)\
**Post date:** [February 2, 2017, 8:26am UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/2 "2017-02-02T08:26:08Z")

</div>

I’m having a similar problem on build 772.

openhab2, on restart, removes bindings/addons (not all), for example, habpanel and habmin, xmbc1. xbmc was in my addons.cfg (which is set to minimal) yet it was uninstalled.

Stuff I had installed through paperui seems to get deleted as well on restart.

I added mapdb and influxdb persistance and they were working fine, including through a restart. I then added them to addons.cfg while openhab was running and it deleted them, and xbmc, when I saved addons.cfg!

Something is amiss. I probably need to be a bit more methodical in debugging but thought I’d throw in a “me too” at this point.

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [February 2, 2017, 8:37am UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/3 "2017-02-02T08:37:05Z")

</div>

> [@maxplay](#):
>
> binding = mqtt,http,ntp,mqttitude

This is the absolute list of bindings that should be installed. So if you want http1 to be installed as well, you need to list it here - otherwise it is (correctly) deinstalled again.

---

<div class="post-metadata">

**Author:** ![skeksil](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/d6d6ee/32.png) [@skeksil](https://community.openhab.org/u/skeksil)\
**Post date:** [February 2, 2017, 8:56am UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/4 "2017-02-02T08:56:36Z")

</div>

Removing the addons.cfg completely seems to have solved me problem. fingers crossed!

---

<div class="post-metadata">

**Author:** ![Dim](https://community.openhab.org/user_avatar/community.openhab.org/dim/32/4568_2.png) [@Dim](https://community.openhab.org/u/Dim)\
**Post date:** [February 2, 2017, 11:23am UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/5 "2017-02-02T11:23:39Z")

</div>

Just a note here:

When using version 1.x bindings, remember to add `1` after the name of the binding in the addons.cfg file, `binding = ` section

Example: `mqtt1` (not `mqtt`)

Note: This applies only to Bindings, not to other Add-ons (like persistence, etc). You can verify the correct name of the bindings using Paper UI → Add-ons → Bindings.

Reference:

> [@Initial package selection and changed add-on ids](https://community.openhab.org/t/initial-package-selection-and-changed-add-on-ids/17953):
>
> All, The latest distro #633 comes again with some changes that I would like to mention: The most visible change is the new option to select the initial package. You will see that newly installed distros now [do not set a package in addons.cfg](https://github.com/openhab/openhab-distro/blob/master/distributions/distribution-resources/src/main/resources/conf/services/addons.cfg#L1) anymore. If the user leaves it like this and starts the runtime, he will be presented this setup page instead of the dashboard in his browser: [image] This is imho again a great step forward to make it easier to get started. Having to find the file conf/…

---

<div class="post-metadata">

**Author:** ![maxplay](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@maxplay](https://community.openhab.org/u/maxplay)\
**Post date:** [February 2, 2017, 3:25pm UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/6 "2017-02-02T15:25:43Z")

</div>

Thank you for your comments.  
@Dim, apparently that’s the solution.

**Maybe** the tutorial [Migration from openHAB 1.x to openHAB 2] ([http://docs.openhab.org/tutorials/migration.html#text-based](http://docs.openhab.org/tutorials/migration.html#text-based)) is not 100% clear about that or at least for me:

In the Migration Tutorial:

> binding = - a comma separated list of the bindings from openHAB 1.x that  
> you use. If you are in doubt of the name of a binding, look in openhab.cfg for  
> that binding’s configurations. The first part of the tag in openhab.cfg will be  
> that name of the binding. For example, the configuration parameters for the  
> MQTT Binding start with “mqtt” in openhab.cfg so the name of the binding is  
> “mqtt”. **_For those bindings that have a 2.0 version, use the name followed by a_**  
> **_\> “1”, for example, to use the 1.9 SNAPSHOT version of the Astro binding instead_**  
> **_\> of the 2.0 version_** , use the name “astro1”. You can find the list of 2.0  
> bindings here.

My comment about this:

- there’s no 2.0 binding for mqtt so it’s not clear that **i must** use the number ‘1’ after the mqtt in addons.cfg

Then, in the same Tutorial:

> An example addons.cfg:  
> …  
> binding = zwave,astro1,http,mqtt,nest,networkhealth,ntp

my comment is:

- the example file is using **mqtt** as a binding, and not **mqtt1**
- the example file is using **http** as a binding, and not **http1**

So probably, those bindings were uninstalled as in my system. (?)

now, my binding addons.cfg section looks like:

```auto
# A comma-separated list of bindings to install (e.g. "sonos,knx,zwave")
binding = mqtt1,http1,ntp,mqttitude1

```

two weird things:

When i execute ‘service restart’; in the events.log ile it says all the items are removed:

```auto
...
2017-02-02 13:17:05.026 [ItemRemovedEvent] - Item 'CamLogiMotion' has been removed.
2017-02-02 13:17:05.029 [ItemRemovedEvent] - Item 'ledAmarillo' has been removed.
2017-02-02 13:17:05.031 [ItemRemovedEvent] - Item 'ledVerde' has been removed.
2017-02-02 13:17:05.033 [ItemRemovedEvent] - Item 'locationMaxi' has been removed.
2017-02-02 13:17:05.035 [ItemRemovedEvent] - Item 'mqttPositionMaxiRaw' has been removed.
...
...

```

Why??? Could you point me out where should i read about it? thanks!

Then, openhab2 won’t start again, i have to execute:

```auto
sudo service openhab2 start

```

The good point is i don’t have to install those bindings again (as before).

---

<div class="post-metadata">

**Author:** ![Dim](https://community.openhab.org/user_avatar/community.openhab.org/dim/32/4568_2.png) [@Dim](https://community.openhab.org/u/Dim)\
**Post date:** [February 2, 2017, 3:38pm UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/7 "2017-02-02T15:38:22Z")

</div>

> [@maxplay](#):
>
> my comment is:- the example file is using mqtt as a binding, and not mqtt1- the example file is using http as a binding, and not http1

There have been some changes to openHAB 2 during the past weeks that it is almost impossible for the authors of the documentation to keep everything up-to-date 🙂 I still have some tutorials within the forum that I must update.  
I ping @rlkoshak here (the author of the migration tutorial).

Your feedback is great, this will help out with the revision.  
(optional) A step further would be to propose a modification to the docs by creating a Pull Request (PR) on [GitHub - openhab/openhab-docs: This repository contains the documentation for openHAB. · GitHub](https://github.com/openhab/openhab-docs) where the content is being constantly enhanced.

For more info, see:

> [@Documenting openHAB 2](https://community.openhab.org/t/documenting-openhab-2/10568):
>
> Hi, I am setting up a brand new install of OpenHab 2 with HABmin 2 and the ZWave bindings, in order to replace Indigo. Doing so, I had to read dozen of pages of posts, articles and FAQ, and did not find a complete documentation. So, I decided to create one while I am setting up everything. It is a work in progress that is accessible [there on Gitbook](https://www.gitbook.com/book/bipphilippe/openhab2-compendium). Feel free to comment the work done !

> [@maxplay](#):
>
> the events.log file it says all the items are removed:

That is ok & normal (because OH2 is shutting down at that moment).

> [@maxplay](#):
>
> Then, openhab2 won’t start again

That is not normal… what do the logs say about the restart attempt?

---

<div class="post-metadata">

**Author:** ![maxplay](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@maxplay](https://community.openhab.org/u/maxplay)\
**Post date:** [February 2, 2017, 6:40pm UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/8 "2017-02-02T18:40:25Z")

</div>

Thanks again @Dim

About the docs, i know is very hard to mantain and i would be proud of helping; i would read the ‘how to’ you linked

now i will fight with my NULL an UNDEF errors that are appearing

About the restart, maybe is related to this post: [https://community.openhab.org/t/sysvinit-restart-does-not-work/21039](https://community.openhab.org/t/sysvinit-restart-does-not-work/21039)

the logs don’t show anything; is just like a Stop and nothing more than that

```auto
$ sudo service openhab2 status
status: Ignoring predefined value for KARAF_HOME
Running ...
$ date
Thu Feb 2 15:18:48 UYT 2017
$ sudo service openhab2 status
status: Ignoring predefined value for KARAF_HOME
Running ...
$ sudo service openhab2 restart
[....] Restarting openHAB2 server: openhab2stop: Ignoring predefined value for KARAF_HOME
start: Ignoring predefined value for KARAF_HOME
. ok
$ date
Thu Feb 2 15:27:23 UYT 2017

$ date
Thu Feb 2 15:36:18 UYT 2017
$ sudo service openhab2 status
status: Ignoring predefined value for KARAF_HOME
Not Running ...
$ date
Thu Feb 2 15:36:28 UYT 2017
$

```

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [February 3, 2017, 7:59pm UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/9 "2017-02-03T19:59:24Z")

</div>

Added an issue and a proposed fix for the migration tutorial here:

> <https://github.com/openhab/openhab-docs/issues/288>
>
> The migration tutorial was written before the convention of appending a 1 to the… end of the 1.9 binding names (e.g. mqtt1). The "Text only" section needs to update to include this fact and take it into account in the example.

@maxplay, as @dim said, this sort of feedback is very helpful and most welcome.

Indeed, this was written before the appending of a 1 for 1.x version bindings was implemented.

---

<div class="post-metadata">

**Author:** ![maxplay](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@maxplay](https://community.openhab.org/u/maxplay)\
**Post date:** [February 4, 2017, 3:48am UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/10 "2017-02-04T03:48:11Z")

</div>

thanks @rlkoshak

About the other issue (can’t restart service) it’s already solved, the solution is in the other post i mentioned before.

thank you very much!  
maxplay

---

<div class="post-metadata">

**Author:** ![Joshua\_Cherwinski](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/3d9bf3/32.png) [@Joshua\_Cherwinski](https://community.openhab.org/u/Joshua_Cherwinski)\
**Post date:** [February 5, 2017, 2:56am UTC](https://community.openhab.org/t/migrating-bindings-are-removed-on-openhab2-start/21830/11 "2017-02-05T02:56:49Z")

</div>

removing all the files from the services folder resolved my issue. Even after renaming them nest1, myq1 they were still uninstalling.
