How to upgrade from 2.1.0 o 2.2.0?

Hello,

I have been running v2.1.0 and would like to upgrade to v2.2.0. The installation is in a FreeBSD jail and I simply unzip the Openhab package and run from there. I have unzipped 2.2.0 package, what files should i copy from 2.1.0 into the 2.2.0 folder?
I have copied over the conf folder to the v2.2.0. But how do i get the things copied over?

Thanks

Are you able to use the update script located in runtime/bin/update? If not, reading what the script does will show you what needs to be done.

This is what i got,

root@openhab:/home/openhab # openhab2/runtime/bin/update
                                         
#########################################
       openHAB 2.x.x update script       
#########################################
                                         
The script must be called from openHAB's root directory.
Either specify a directory or place this update script in and run from openHAB's root folder.
root@openhab:/home/openhab # cd openhab2/
root@openhab:/home/openhab/openhab2 # runtime/bin/update 
                                         
#########################################
       openHAB 2.x.x update script       
#########################################
                                         
Making Temporary Directory
Downloading openHAB 2.2.0...
######################################################################## 100.0%
Update script in .zip archive found, using that instead.
                                         
#########################################
       openHAB 2.x.x update script       
#########################################
                                         
Making Temporary Directory
The script will attempt to update openHAB to version 2.2.0
Is this okay? [y/N]: y
Removing openHAB System Files...
mv: rename /usr/home/openhab/openhab2/userdata/etc/custom.system.properties to /tmp/openhab/userdata/etc/custom.system.properties: No such file or directory
Clearing cache...
Updating openHAB...
Found an openHAB addons file, replacing with new version...
######################################################################## 100.0%
Deleting temporary files...
Restoring previous file ownership (openhab:openhab)

SUCCESS: openHAB updated from 2.1.0 to 2.2.0

Looks like it upgraded to me! All working okay?

Unfortunately, it doesnt start from my rc.d script anymore.

root@openhab:~ # service openhab2 start
Starting openhab2...
root@openhab:~ # service openhab2 status
openhab2 is not running.


root@openhab:~ # cat /usr/local/etc/rc.d/openhab2 
#!/bin/sh
#
# $FreeBSD:$
#
# PROVIDE: openhab
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for openhab in /etc/rc.conf:
# Mandatory:
# openhab_enable (bool):
#   Set to "NO" by default.
#   Set it to "YES" to enable openhab
#
# Optional:
# openhab_user (bool):
#   Set to "openhab" by default.
#
# openhab_http_port (num):
#   Default to 8080
#
# openhab_https_port (num):
#   Default to 8443
#
# openhab_telnet_port (num):
#   Default to 5555
#
# openhab_home (str):
#   Default to "/usr/local/openhab"
#

. /etc/rc.subr

name="openhab2"
rcvar="${name}_enable"
pidfile="/var/run/${name}.pid"

load_rc_config "${name}"

: ${openhab_enable="NO"}
: ${openhab_user="openhab"}
: ${openhab_http_port=8080}
: ${openhab_https_port=8443}
: ${openhab_telnet_port=5555}
: ${openhab_home="/home/openhab/openhab2"}

required_files="${openhab_home}/conf/services/runtime.cfg"

#cp=$(find ${openhab_home}/server -name "org.eclipse.equinox.launcher_*.jar" | sort | tail -1);

java_command="/usr/local/bin/java
         -Dopenhab.home=${openhab_home}
         -Dopenhab.conf=${openhab_home}/conf
         -Dopenhab.runtime=${openhab_home}/runtime
         -Dopenhab.userdata=${openhab_home}/userdata
         -Dopenhab.logdir=${openhab_home}/userdata/logs
         -Dfelix.cm.dir=${openhab_home}/userdata/config
         -Djetty.host=0.0.0.0 
         -Dorg.ops4j.pax.web.listening.addresses=0.0.0.0
         -Dorg.osgi.service.http.port=${openhab_http_port}
         -Dorg.osgi.service.http.port.secure=${openhab_https_port}
         -Djava.awt.headless=true -XX:+UseG1GC
         -Djava.endorsed.dirs=/usr/local/openjdk8/jre/lib/endorsed:/usr/local/openjdk8/lib/endorsed:${openhab_home}/runtime/lib/endorsed 
         -Djava.ext.dirs=/usr/local/openjdk8/jre/lib/ext:/usr/local/openjdk8/lib/ext:${openhab_home}/runtime/lib/ext
         -Dkaraf.instances=${openhab_home}/runtime/instances
         -Dkaraf.home=${openhab_home}/runtime
         -Dkaraf.base=${openhab_home}/userdata
         -Dkaraf.data=${openhab_home}/userdata
         -Dkaraf.etc=${openhab_home}/userdata/etc
         -Dkaraf.restart.jvm.supported=true
         -Djava.io.tmpdir=${openhab_home}/userdata/tmp
         -Djava.util.logging.config.file=${openhab_home}/userdata/etc/java.util.logging.properties
         -Dkaraf.startLocalConsole=false
         -Dkaraf.startRemoteShell=false
         -classpath ${openhab_home}/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar:${openhab_home}/runtime/lib/boot/org.apache.karaf.jaas.boot-4.0.8.jar:${openhab_home}/runtime/lib/boot/org.apache.karaf.main-4.0.8.jar:${openhab_home}/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main"

command="/usr/sbin/daemon"
command_args="-p ${pidfile} -u ${openhab_user} -f ${java_command}"

start_precmd="pid_touch"
start_cmd="openhab_start"
stop_cmd="openhab_stop"
status_cmd="openhab_status"

pid_touch() {
    touch ${pidfile}
    chown ${openhab_user} ${pidfile}
}

openhab_start() {
        cd ${openhab_home}
    echo "Starting ${name}..."
    exec ${command} ${command_args}
}

openhab_stop() {
    rc_pid=$(openhab_check_pidfile ${pidfile})
    if [ -z "${rc_pid}" ]; then
        [ -n "${rc_fast}" ] && return 0
        echo "${name} not running? (check ${pidfile})."
        return 1
    fi
    echo "Stopping ${name}..."
    kill -KILL ${rc_pid} 2> /dev/null && echo "Killed."
    rm -f ${pidfile}
        sleep 1
}
 
openhab_status() {
    rc_pid=$(openhab_check_pidfile $pidfile)
    if [ -n "${rc_pid}" ]; then
        echo "${name} is running as pid ${rc_pid}."
    else
        echo "${name} is not running."
        return 1
    fi
}

openhab_check_pidfile() {
    _pidfile=$1
    if [ -z "${_pidfile}" ]; then
        err 3 'USAGE: openhab_check_pidfile pidfile'
    fi
    if [ ! -f ${_pidfile} ]; then
        debug "pid file (${_pidfile}): not readable."
        return
    fi
    read _pid < ${_pidfile}
    if [ -z "${_pid}" ]; then
        debug "pid file (${_pidfile}): no pid in file."
        return
    fi
        echo -n ${_pid}
}

run_rc_command "$1"