goofball222/unifi

Change to Mongo as separate service

pnelsonsr opened this issue · 2 comments

This is not a bug but a question...

I have been running unifi with mongo as one docker container. I saw the message in startup that said to consider running mongo as a separate container. My question is if there is anything I need to do to export the mongo data to the separate mongo container?

You can take the UniFi data/db directory and attach it to an instance of https://hub.docker.com/_/mongo

You'll need to match that mongo version to the version or one version higher of your existing database files. Unless you've done something odd to your install a 3.6 version should work,

I'd heavily recommend making a backup copy of your data before messing around with converting to an externalized mongo DB.

No, I don't do anything special or unique or odd with the unifi container startup. So I'm going to back up and then try your docker-compose script (separate containers), which calls the mongo image you stated so I think it should be OK. My Previous start looks like:
docker run --name ${sn} -h ${sn}${se} -d -p 3478:3478/udp -p 6789:6789 -p 8080:8080 -p ${sp}:8443 -p 8880:8880 -p 8843:8843 -p 10001:10001/udp -v ${pd}/cert:${dd}/cert -v ${pd}/data:${dd}/data -v ${pd}/logs:${dd}/logs goofball222/unifi
where variables $sn $sp $pd $dd are set prior to the run.