[SOLVED] Mongorestore restoration issue

Questions about WAPT Server / Requests and help related to the WAPT server
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Matthew
Messages: 14
Registration: September 19, 2016 - 8:50 p.m.

April 5, 2018 - 10:59

Server: Debian Stretch x64
waptserveur 1.3.13.0

Good morning,
To migrate to version 1.5 of wapt I had to switch from ubuntu server 16.04 to debian stretch.
So I followed the procedure
https://www.wapt.fr/fr/doc/waptserver_u ... erver.html

Upon execution of the command

Code: Select all

mongodump
I obtained a dump folder which I saved.
It contains an empty admin folder and a wapt folder with the following files:
hosts.bson hosts.metadata.json system.indexes.bson

I then backed up the packages as instructed and installed a clean version of the Debian server and then Wapt Server version 1.3.13.0

I restored the contents of the wapt and wapt-host folders in the www/ folder.

So far, everything has gone well.

I'm having a problem restoring the MongoDB database:

I go to the location where I saved the previously created dump folder and execute the command

Code: Select all

mongorestore /root/wapt.dump
gives me the error

Code: Select all

Failed: mongorestore target '/root/wapt.dump' invalid: stat /root/wapt.dump: no such file or directory
Is there an error in my procedure?
THANKS
Last edited by Matthieu on 05 Apr 2018 - 12:59, edited 1 time.
Matthew
Messages: 14
Registration: September 19, 2016 - 8:50 p.m.

April 5, 2018 - 11:46

Server: Debian Stretch x64
waptserveur 1.3.13.0
console 1.3.13.0 on Windows 10


I tried to navigate to the folder where my database had been saved, which contains the dump folder.
I launched the order

Code: Select all

mongorestore dump/
A restoration appears to have been carried out with errors:

Code: Select all

2018-04-05T11:34:04.880+0200    building a list of dbs and collections to restore from dump dir
2018-04-05T11:34:04.887+0200    reading metadata for wapt.hosts from dump/wapt/hosts.metadata.json
2018-04-05T11:34:04.914+0200    restoring wapt.hosts from dump/wapt/hosts.bson
2018-04-05T11:34:05.354+0200    error: multiple errors in bulk operation:
  - E11000 duplicate key error collection: wapt.hosts index: uuid_1 dup key: { : "CD00EF00-A21C-11E1-BD3B-AC162D06646F" }
 
And several other lines of the same type as the last one. Nothing catastrophic?

but when I launch the wapt console on the computer I do see all my computers present with their status (up to date, error, ...) and the list of packages installed on each machine but the private repository is empty.
Matthew
Messages: 14
Registration: September 19, 2016 - 8:50 p.m.

April 5, 2018 - 11:59

In the console I have an error on the repository but I cannot see the details of the error because the window cannot be enlarged.
Picture

I wonder if this isn't an ownership/access rights issue with the folder in www/

Currently I have this:

Code: Select all

root@ltsp01:/var/www# ls -la
total 60
drwxr-xr-x  8 root root      4096 avril  4 12:05 .
drwxr-xr-x 12 root root      4096 avril  4 12:04 ..
drwxr-xr-x  2 root root      4096 avril  4 12:05 html
drwxr-xr-x  3 wapt root     20480 avril  5 10:23 wapt
drwxr-xr-x  2 wapt www-data  4096 avril  4 12:05 waptdev
drwxr-xr-x  2 wapt www-data  4096 avril  4 12:05 wapt-group
drwxr-xr-x  3 wapt root     16384 avril  5 10:30 wapt-host
drwxr-xr-x  2 wapt www-data  4096 avril  4 12:05 waptwua
Attachments
Capture.PNG
Capture.PNG (9.99 KB) Viewed 5866 times
Matthew
Messages: 14
Registration: September 19, 2016 - 8:50 p.m.

April 5, 2018 - 12:58

And there you have it:

A little tap

Code: Select all

chown -R wapt:www-data /var/www/wapt/
chown -R wapt:www-data /var/www/wapt-host/
chown -R wapt:www-data /var/www/wapt-group/
then a scan of the directories

Code: Select all

/usr/bin/python /opt/wapt/wapt-scanpackages.py /var/www/wapt/
/usr/bin/python /opt/wapt/wapt-scanpackages.py /var/www/wapt-host/
/usr/bin/python /opt/wapt/wapt-scanpackages.py /var/www/wapt-group/
Finally, a restart of services:

Code: Select all

systemctl start waptserver
indicated in the section https://www.wapt.fr/fr/doc/waptserver_backup.html

And everything went back to normal for the migration from Ubuntu 16.04 to Debian Stretch.

I'm going to be able to start the update to Wapt server 1.5! :)
Locked