Closed tszumowski closed 1 year ago
Hi @tszumowski 👋
There aren't currently any builtin command/methods for DB backups, but you can easily do it yourself by interacting directly with MongoDB.
FiftyOne installs include a MongoDB install, and you can run the following command to locate its mongod
executable and the DB directory:
import fiftyone.core.service as fos
service = fos.DatabaseService()
print(service.command)
Here's the output on my setup:
['/Users/Brian/dev/env/fifty3/lib/python3.6/site-packages/fiftyone/db/bin/mongod',
'--dbpath',
'/Users/Brian/.fiftyone/var/lib/mongo',
'--logpath',
'/Users/Brian/.fiftyone/var/lib/mongo/log/mongo.log',
'--port',
'0',
'--nounixsocket']
I know you asked explicitly about full database backups, but I'll also mention that using dataset.clone() is a convenient way to create a temporary, independent copy of a dataset in cases where you want to test something before performing it on the source dataset.
@brimoor
Can i migrate mongodb to a remote server? or it's okay to just backup the whole files under /Users/Brian/.fiftyone/var/lib/mongo?
you would use a tool like mongodump and not just grab the files directly. closing
Question
I understand I can export a dataset to JSON form using the
fiftyone datasets export
command. However, what if I would like a full backup of the database? Is there a way to do that?