Add some notes about updating across mongodb version to unifi pkg/README.

Remove the notes about kern.maxthreads now that the OS defaults have been
raised.
This commit is contained in:
sthen 2022-09-08 12:30:22 +00:00
parent 130be3eeca
commit fc18529fa4
8 changed files with 212 additions and 31 deletions

View File

@ -1,6 +1,6 @@
V= 5.14.23 V= 5.14.23
SNAPPY_V= 1.1.8.4 SNAPPY_V= 1.1.8.4
REVISION= 15 REVISION= 16
REPLACE_LOG4J= Yes REPLACE_LOG4J= Yes

View File

@ -2,14 +2,14 @@
| Running ${PKGSTEM} on OpenBSD | Running ${PKGSTEM} on OpenBSD
+----------------------------------------------------------------------- +-----------------------------------------------------------------------
If using UniFi on a system with other threaded programs, it is likely that
sysctl kern.maxthread would need to be increased from the default (usually
done in /etc/sysctl.conf).
After installing and starting UniFi, connect to https://localhost:8443/ to After installing and starting UniFi, connect to https://localhost:8443/ to
configure. (Additional ports are used for AP<>controller communications). configure. (Additional UDP and TCP ports are used for AP<>controller
communications; check the documentation if you are configuring firewalls).
To import your own signed SSL key/certificate: 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 # rcctl stop unifi
# cd ${TRUEPREFIX}/share/unifi/data # cd ${TRUEPREFIX}/share/unifi/data
@ -21,3 +21,49 @@ To import your own signed SSL key/certificate:
-srcstoretype PKCS12 -srcstorepass aircontrolenterprise \ -srcstoretype PKCS12 -srcstorepass aircontrolenterprise \
-destkeystore keystore.new -storepass aircontrolenterprise -destkeystore keystore.new -storepass aircontrolenterprise
# rcctl start unifi # 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

View File

@ -1,6 +1,6 @@
V= 5.6.42 V= 5.6.42
SNAPPY_V= 1.1.2.6 SNAPPY_V= 1.1.2.6
SNAPPY_S= SNAPPY_S=
REVISION= 16 REVISION= 18
.include <bsd.port.mk> .include <bsd.port.mk>

View File

@ -2,18 +2,14 @@
| Running ${PKGSTEM} on OpenBSD | Running ${PKGSTEM} on OpenBSD
+----------------------------------------------------------------------- +-----------------------------------------------------------------------
If using UniFi on a system with other threaded programs, it is likely that
sysctl kern.maxthread would need to be increased from the default (usually
done in /etc/sysctl.conf)..
After installing and starting UniFi, connect to https://localhost:8443/ to After installing and starting UniFi, connect to https://localhost:8443/ to
configure. (Additional ports are used for AP<>controller communications). configure. (Additional UDP and TCP ports are used for AP<>controller
communications; check the documentation if you are configuring firewalls).
WARNING: In this LTS version of UniFi, the admin password is available Importing CA-signed certificates (optional)
to localhost users without authentication: -------------------------------------------
$ echo 'db.admin.find()' | mongo --quiet 127.0.0.1:27117/ace If you would prefer to replace the auto-generated self-signed certificate
with a CA-signed certificate, you can import it like this:
To import your own signed SSL key/certificate:
# rcctl stop unifi # rcctl stop unifi
# cd ${TRUEPREFIX}/share/unifi/data # cd ${TRUEPREFIX}/share/unifi/data
@ -25,3 +21,49 @@ To import your own signed SSL key/certificate:
-srcstoretype PKCS12 -srcstorepass aircontrolenterprise \ -srcstoretype PKCS12 -srcstorepass aircontrolenterprise \
-destkeystore keystore.new -storepass aircontrolenterprise -destkeystore keystore.new -storepass aircontrolenterprise
# rcctl start unifi # 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

View File

@ -1,6 +1,6 @@
V= 6.0.45 V= 6.0.45
SNAPPY_V= 1.1.8.4 SNAPPY_V= 1.1.8.4
REVISION= 13 REVISION= 14
REPLACE_LOG4J= Yes REPLACE_LOG4J= Yes

View File

@ -2,14 +2,14 @@
| Running ${PKGSTEM} on OpenBSD | Running ${PKGSTEM} on OpenBSD
+----------------------------------------------------------------------- +-----------------------------------------------------------------------
If using UniFi on a system with other threaded programs, it is likely that
sysctl kern.maxthread would need to be increased from the default (usually
done in /etc/sysctl.conf).
After installing and starting UniFi, connect to https://localhost:8443/ to After installing and starting UniFi, connect to https://localhost:8443/ to
configure. (Additional ports are used for AP<>controller communications). configure. (Additional UDP and TCP ports are used for AP<>controller
communications; check the documentation if you are configuring firewalls).
To import your own signed SSL key/certificate: 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 # rcctl stop unifi
# cd ${TRUEPREFIX}/share/unifi/data # cd ${TRUEPREFIX}/share/unifi/data
@ -21,3 +21,49 @@ To import your own signed SSL key/certificate:
-srcstoretype PKCS12 -srcstorepass aircontrolenterprise \ -srcstoretype PKCS12 -srcstorepass aircontrolenterprise \
-destkeystore keystore.new -storepass aircontrolenterprise -destkeystore keystore.new -storepass aircontrolenterprise
# rcctl start unifi # 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

View File

@ -1,5 +1,6 @@
V= 7.2.94 V= 7.2.94
SNAPPY_V= 1.1.8.4 SNAPPY_V= 1.1.8.4
BUILD_V= -4d656fb797 BUILD_V= -4d656fb797
REVISION= 0
.include <bsd.port.mk> .include <bsd.port.mk>

View File

@ -2,14 +2,14 @@
| Running ${PKGSTEM} on OpenBSD | Running ${PKGSTEM} on OpenBSD
+----------------------------------------------------------------------- +-----------------------------------------------------------------------
If using UniFi on a system with other threaded programs, it is likely that
sysctl kern.maxthread would need to be increased from the default (usually
done in /etc/sysctl.conf).
After installing and starting UniFi, connect to https://localhost:8443/ to After installing and starting UniFi, connect to https://localhost:8443/ to
configure. (Additional ports are used for AP<>controller communications). configure. (Additional UDP and TCP ports are used for AP<>controller
communications; check the documentation if you are configuring firewalls).
To import your own signed SSL key/certificate: 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 # rcctl stop unifi
# cd ${TRUEPREFIX}/share/unifi/data # cd ${TRUEPREFIX}/share/unifi/data
@ -21,3 +21,49 @@ To import your own signed SSL key/certificate:
-srcstoretype PKCS12 -srcstorepass aircontrolenterprise \ -srcstoretype PKCS12 -srcstorepass aircontrolenterprise \
-destkeystore keystore.new -storepass aircontrolenterprise -destkeystore keystore.new -storepass aircontrolenterprise
# rcctl start unifi # 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