Page 1 of 1

[SOLVED] Mongorestore restoration issue

Published: April 5, 2018 - 10:59 AM
by Matthew
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

Re: Problem restoring mongorestore

Published: April 5, 2018 - 11:46 AM
by Matthew
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.

Re: Problem restoring mongorestore

Published: April 5, 2018 - 11:59 AM
by Matthew
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

Re: Problem restoring mongorestore

Published: April 5, 2018 - 12:58 PM
by Matthew
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! :)