69 lines
2.9 KiB
Text
69 lines
2.9 KiB
Text
+-----------------------------------------------------------------------
|
|
| Running ${PKGSTEM} on OpenBSD
|
|
+-----------------------------------------------------------------------
|
|
|
|
After installing and starting UniFi, connect to https://localhost:8443/ to
|
|
configure. (Additional UDP and TCP ports are used for AP<>controller
|
|
communications; check the documentation if you are configuring firewalls).
|
|
|
|
Importing CA-signed certificates (optional)
|
|
-------------------------------------------
|
|
If you would prefer to replace the auto-generated self-signed certificate
|
|
with a CA-signed certificate, you can import it like this:
|
|
|
|
# rcctl stop unifi
|
|
# cd ${TRUEPREFIX}/share/unifi/data
|
|
# openssl pkcs12 -export -in /etc/ssl/server.crt \
|
|
-inkey /etc/ssl/private/server.key \
|
|
-certfile /etc/ssl/intermediate.crt -out unifi.p12 \
|
|
-name unifi -password pass:aircontrolenterprise
|
|
# $JAVAHOME/bin/keytool -importkeystore -srckeystore unifi.p12 \
|
|
-srcstoretype PKCS12 -srcstorepass aircontrolenterprise \
|
|
-destkeystore keystore.new -storepass aircontrolenterprise
|
|
# rcctl start unifi
|
|
|
|
Migrating between MongoDB versions
|
|
----------------------------------
|
|
Unifi uses MongoDB to store its database. Databases can only be updated
|
|
directly across one major MongoDB version (3.4->3.6, 3.6->4.0, 4.0->4.2,
|
|
4.2->4.4).
|
|
|
|
If you need to update MongoDB across a larger gap, the simplest way to
|
|
move Unifi data across is to make sure you have an up-to-date Unifi .unf
|
|
backup (check /usr/local/share/unifi/data/backup and maybe trigger one
|
|
from the web interface). Then stop Unifi and move the old MongoDB
|
|
database out of the way (the directory /usr/local/share/unifi/data/db),
|
|
restart Unifi and open the web interface; it will create a new database
|
|
and allow restoring from a backup file.
|
|
|
|
Alternatively "mongodump" (in the mongo-tools package) can be used.
|
|
You probably won't need it, but here are some instructions that worked
|
|
for the port maintainer and may be useful.
|
|
|
|
Backup with the old mongodb version installed and unifi running -
|
|
|
|
$ mkdir unifi-backup; cd unifi-backup
|
|
$ mongodump --port=27117
|
|
$ doas rcctl stop unifi
|
|
$ doas cp -rp /usr/local/share/unifi /usr/local/share/unifi.backup
|
|
|
|
Then after installing the newer mongodb you can restore - the steps
|
|
below increase the number of file handles from the default to avoid
|
|
problems.
|
|
|
|
# su -m _unifi -i
|
|
$ ulimit -n 1024
|
|
$ mv /usr/local/share/unifi/data/db /usr/local/share/unifi/data/db.old
|
|
$ mkdir /usr/local/share/unifi/data/db
|
|
$ mongod --dbpath /usr/local/share/unifi/data/db --port 27117 \
|
|
--unixSocketPrefix /usr/local/share/unifi/run --logRotate reopen \
|
|
--logappend --logpath /usr/local/share/unifi/logs/mongod.log \
|
|
--pidfilepath /usr/local/share/unifi/run/mongod.pid \
|
|
--wiredTigerEngineConfigString=cache_size=256M --bind_ip 127.0.0.1 &
|
|
$ mongorestore --port=27117
|
|
$ kill `cat /usr/local/share/unifi/run/mongod.pid`
|
|
$ exit
|
|
|
|
and restart unifi:
|
|
|
|
# rcctl start unifi
|