Backup and Restore MongoDB

Hello Community,

We are planning to establish DataGerry as our new database.
Our Database (MongoDB) and Webserver are installed seperately on 2 different VM’s.

But we have a couple of questions.

  1. Is it possible to create a backup of the database and restore it? I found multiple ways from MongoDB. But there are many different ways depending on the mongoDB version. The first try was sucessful but the second wasnt and leaded to datagerry.service crashing on start.
    What would be the best practice for creating a backup of the database?

  2. The documentation from DataGerry includes old versions of MongoDB, RabbitMQ and Erlang. Is DataGerry compatible to the latest versions or only to the versions of the documentation?

Thanks in advance and kind regards
Lukas

Hi @LukasB and welcome to the community.

About your first question:
Yes it is possible to create a backup of the database and restore it. There should be plenty of info about it for example here https://www.mongodb.com/docs/manual/tutorial/backup-and-restore-tools/ .

I can’t say what went wrong with your second back and restore process but this sounds more like an issue with the backup. Can you provide more information about what went wrong with the datagerry.service?

The best practice to create a backup would be to follow the official MongoDB guidelines for creating and restoring a backup.

About your second question:
Datagerry should be also compatible with newer versions of MongoDB and RabbitMQ but they are currently not included in our tests so far (this will change in the future). Which versions would you like to use ?

BR Adnan

Hi @adnan.smajic ,

Thanks for your reply.
I will try that out to get the Backup running.

To the second question:
I try to run following versions:

rabbitmq-server-3.12.6-1.el8.noarch
erlang-26.1.2-1.el8.x86_64
mongodb-org-7.0.2-1.el8.x86_64
Which are the latest stable version’s today.

When I try to start the datagerry.service it crashed after ~5seconds with this message:


File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py”, line 493, in exec_module
File “xhtml2pdf/tags.py”, line 10, in
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py”, line 493, in exec_module
File “xhtml2pdf/xhtml2pdf_reportlab.py”, line 28, in
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py”, line 493, in exec_module
File “xhtml2pdf/util.py”, line 74, in
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py”, line 493, in exec_module
File “reportlab/graphics/renderSVG.py”, line 146, in
File “reportlab/graphics/renderSVG.py”, line 286, in SVGCanvas
File “cmdb/interface/gunicorn.py”, line 72, in _shutdown
AttributeError: ‘NoneType’ object has no attribute ‘terminate’

Just a short tail there are more messages like this.
With the versions in the datagerry documentation everything works.

Dont know if I made a mistake or the new version’s are not compatible with datagerry 1.7.2.

Kind regards

Hi @LukasB ,
can you post please a complete error log ?

BR Adnan

Hi @adnan.smajic

sure here is a new log.

Oct 16 11:12:07  systemd[1]: Configuration file /usr/lib/systemd/system/datagerry.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Oct 16 11:12:07  systemd[1]: Configuration file /usr/lib/systemd/system/datagerry.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Oct 16 11:12:07  systemd[1]: Configuration file /usr/lib/systemd/system/datagerry.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Oct 16 11:12:14  systemd[1]: Configuration file /usr/lib/systemd/system/datagerry.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Oct 16 11:12:14  systemd[1]: Started DATAGERRY - Enterprise grade OpenSource CMDB.
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- DATAGERRY starting... (__main__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- Checking database connection with cmdb.conf data (__main__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- Database connection established. (__main__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- CHECK ROUTINE: STARTED... (__check__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- CHECK ROUTINE: Checking database collection validation (__check__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- CHECK ROUTINE: Database collection validation status True (__check__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- CHECK ROUTINE: FINISHED! (__check__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- SETUP ROUTINE: STARTED... (__setup__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- SETUP ROUTINE: Checking database connection (__setup__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- SETUP ROUTINE: Database connection status True (__setup__.py)
Oct 16 11:12:15 [49848]: [2023-10-16 11:12:15][INFO    ] --- SETUP ROUTINE: FINISHED! (__setup__.py)
Oct 16 11:12:15 [49848]:
Oct 16 11:12:15 [49848]:     ########################################################################
Oct 16 11:12:15 [49848]:
Oct 16 11:12:15 [49848]:     @@@@@     @   @@@@@@@ @           @@@@@  @@@@@@@ @@@@@   @@@@@  @@    @@
Oct 16 11:12:15 [49848]:     @    @    @@     @    @@         @@@@@@@ @@@@@@@ @@@@@@  @@@@@@ @@@  @@@
Oct 16 11:12:15 [49848]:     @     @  @  @    @   @  @       @@@   @@ @@@     @@   @@ @@   @@ @@  @@
Oct 16 11:12:15 [49848]:     @     @  @  @    @   @  @       @@       @@@@@@  @@   @@ @@   @@  @@@@
Oct 16 11:12:15 [49848]:     @     @ @    @   @  @    @      @@   @@@ @@@@@@  @@@@@@  @@@@@@   @@@@
Oct 16 11:12:15 [49848]:     @     @ @@@@@@   @  @@@@@@      @@   @@@ @@@     @@@@@   @@@@@     @@
Oct 16 11:12:15 [49848]:     @     @ @    @   @  @    @      @@@   @@ @@@     @@ @@@  @@ @@@    @@
Oct 16 11:12:15 [49848]:     @    @ @      @  @ @      @      @@@@@@@ @@@@@@@ @@  @@@ @@  @@@   @@
Oct 16 11:12:15 [49848]:     @@@@@  @      @  @ @      @       @@@@@@ @@@@@@@ @@  @@@ @@  @@@   @@
Oct 16 11:12:15 [49848]:
Oct 16 11:12:15 [49848]:     ########################################################################
Oct 16 11:12:15 [49848]:
Oct 16 11:12:15 [49848]: Welcome to DATAGERRY
Oct 16 11:12:15 [49848]: Starting system with following parameters:
Oct 16 11:12:15 [49848]: {'keys': False, 'debug': False, 'start': True, 'config_file': '/etc/datagerry/cmdb.conf'}
Oct 16 11:12:15 [49848]:
Oct 16 11:12:15 [49848]: Copyright (C) 2019 NETHINKS GmbH
Oct 16 11:12:15 [49848]: licensed under the terms of the GNU Affero General Public License version 3
Oct 16 11:12:15 [49848]:
Oct 16 11:12:15 [49891]: [2023-10-16 11:12:15][INFO    ] --- start exportd ... (service.py)
Oct 16 11:12:15 [49891]: [2023-10-16 11:12:15][INFO    ] --- exportd: start run (service.py)
Oct 16 11:12:15 [49891]: [2023-10-16 11:12:15][ERROR   ] --- exportd: EventReceiverAmqp connection error (event_manager.py)
Oct 16 11:12:15 [49891]: [2023-10-16 11:12:15][INFO    ] --- shutdown exportd ... (service.py)
Oct 16 11:12:15 [49891]: [2023-10-16 11:12:15][ERROR   ] --- exportd: EventSenderAmqp connection error (event_manager.py)
Oct 16 11:12:16 [49848]: [2023-10-16 11:12:16][INFO    ] --- Process manager started: True (__main__.py)
Oct 16 11:12:16 [49896]: [2023-10-16 11:12:16][INFO    ] --- start webapp ... (service.py)
Oct 16 11:12:16 [49896]: [2023-10-16 11:12:16][ERROR   ] --- webapp: EventSenderAmqp connection error (event_manager.py)
Oct 16 11:12:16 [49896]: [2023-10-16 11:12:16][ERROR   ] --- webapp: EventReceiverAmqp connection error (event_manager.py)
Oct 16 11:12:16 [49848]: [2023-10-16 11:12:16][INFO    ] --- DATAGERRY successfully started (__main__.py)
Oct 16 11:12:16 [49891]: [2023-10-16 11:12:16][INFO    ] --- exportd: end run (service.py)
Oct 16 11:12:16 [49891]: [2023-10-16 11:12:16][INFO    ] --- shutdown exportd completed (service.py)
Oct 16 11:12:16 [49896]: Process webapp:
Oct 16 11:12:16 [49896]: Traceback (most recent call last):
Oct 16 11:12:16 [49896]:   File "multiprocessing/process.py", line 258, in _bootstrap
Oct 16 11:12:16 [49896]:   File "multiprocessing/process.py", line 93, in run
Oct 16 11:12:16 [49896]:   File "cmdb/process_management/service.py", line 78, in start
Oct 16 11:12:16 [49896]:   File "cmdb/interface/gunicorn.py", line 58, in _run
Oct 16 11:12:16 [49896]:   File "cmdb/interface/rest_api/__init__.py", line 51, in create_rest_api
Oct 16 11:12:16 [49896]:   File "cmdb/interface/rest_api/__init__.py", line 88, in register_blueprints
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "cmdb/interface/rest_api/docapi_routes.py", line 30, in <module>
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "cmdb/docapi/docapi_base.py", line 19, in <module>
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "cmdb/docapi/doctypes.py", line 18, in <module>
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "xhtml2pdf/pisa.py", line 19, in <module>
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "xhtml2pdf/document.py", line 4, in <module>
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "xhtml2pdf/context.py", line 14, in <module>
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "reportlab/platypus/__init__.py", line 10, in <module>
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Oct 16 11:12:16 [49896]:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Oct 16 11:12:16 [49896]:   File "/usr/local/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
Oct 16 11:12:16 [49896]:   File "reportlab/platypus/paragraph.py", line 905, in <module>
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/re.py", line 233, in compile
Oct 16 11:12:16 [49896]:     return _compile(pattern, flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/re.py", line 301, in _compile
Oct 16 11:12:16 [49896]:     p = sre_compile.compile(pattern, flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 566, in compile
Oct 16 11:12:16 [49896]:     code = _code(p, flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 551, in _code
Oct 16 11:12:16 [49896]:     _compile(code, p.data, flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 146, in _compile
Oct 16 11:12:16 [49896]:     _compile(code, p, (flags | add_flags) & ~del_flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 187, in _compile
Oct 16 11:12:16 [49896]:     _compile(code, av, flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 146, in _compile
Oct 16 11:12:16 [49896]:     _compile(code, p, (flags | add_flags) & ~del_flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 187, in _compile
Oct 16 11:12:16 [49896]:     _compile(code, av, flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 134, in _compile
Oct 16 11:12:16 [49896]:     _compile(code, av[2], flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 146, in _compile
Oct 16 11:12:16 [49896]:     _compile(code, p, (flags | add_flags) & ~del_flags)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 108, in _compile
Oct 16 11:12:16 [49896]:     _compile_charset(av, flags, code, fixup, fixes)
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 226, in _compile_charset
Oct 16 11:12:16 [49896]:     for op, av in _optimize_charset(charset, fixup, fixes):
Oct 16 11:12:16 [49896]:   File "/usr/lib64/python3.6/sre_compile.py", line 273, in _optimize_charset
Oct 16 11:12:16 [49896]:     charmap[i] = 1
Oct 16 11:12:16 [49896]:   File "cmdb/interface/gunicorn.py", line 72, in _shutdown
Oct 16 11:12:16 [49896]: AttributeError: 'NoneType' object has no attribute 'terminate'
Oct 16 11:12:16  systemd[1]: datagerry.service: Succeeded.
Oct 16 11:12:19  systemd[1]: Configuration file /usr/lib/systemd/system/datagerry.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Oct 16 11:12:19  systemd[1]: Configuration file /usr/lib/systemd/system/datagerry.service is marked executable. Please remove executable permission bits. Proceeding anyway.

Hi @LukasB,
sry for the long waiting but we were bussy releasing version 2.0.0.

Your log is stating that there is an issue with connecting to the RabbitMQ-Service.
Oct 16 11:12:15 [49891]: [2023-10-16 11:12:15][ERROR ] — exportd: EventReceiverAmqp connection error (event_manager.py)

Which version of RabbitMQ are you using?
Which OS are you using in which version?

Your logs also show that you are using python 3.6, we are already up to python 3.9 (you could try it with this one as well).

BR Adnan

Hi @adnan.smajic ,

You’re right. The Problem was, that RabbitMQ refused the default credentials “guest | guest”.
You can only use default credentials when you connect via localhost.

[error] <0.582.0> PLAIN login refused: user 'guest' can only connect via localhost

So I changed the credentials and it works just fine.

I’am using RabbitMQ in Version 3.12.10-1.el8
and my OS is Red Hat Enterprise Linux release 8.8

So thanks for your help.

Kind regards