Feature #3429

Backport restore from old backups

Added by Filippo Carletti almost 5 years ago. Updated over 4 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-restore-data
Target version:v6.8
Resolution: NEEDINFO:No

Description

I'd like to evaluate a backport of this feature available in NethServer 7:
https://github.com/NethServer/dev/issues/5108

Associated revisions

Revision 2d7f331b
Added by Giacomo Sanchietti over 4 years ago

Web UI: better handling of backupFileList field. Refs #3429

- avoid inconsitent calls to db command
- link labels to radio buttons
- always display a message after restore

Revision 0a72c89b
Added by Giacomo Sanchietti over 4 years ago

Handle duc update from 1.0 to 1.4. Refs #3429

Revision 03606ff9
Added by Giacomo Sanchietti over 4 years ago

Handle duc update from 1.0 to 1.4. Refs #3429

Revision 39222e3b
Added by Giacomo Sanchietti over 4 years ago

nethserver-restore-data-duc-index: fix syntax for new duc release. Refs #3429

Revision 465a44a4
Added by Giacomo Sanchietti over 4 years ago

Hanlde duc upgrade. Refs #3429

History

#1 Updated by Giacomo Sanchietti almost 5 years ago

I would like also to update duc to latest release (both on NS 6 and NS 7).

See the updated spec: https://github.com/gsanchietti/duc/commit/3c6e0aa04f8776d0fa6f26735acbde884f455e03
We should open a new pull request to upstream repository.

RPM compiled with:

mock --resultdir=. -r nethserver-6-x86_64 -D 'dist .el6'  --buildsrpm --spec duc.spec --sources .
mock --resultdir=. -r nethserver-6-x86_64 -D 'dist .el6'  duc-1.4.1-1.el6.src.rpm

#2 Updated by Giacomo Sanchietti over 4 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

#3 Updated by Giacomo Sanchietti over 4 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 20 to 30

#4 Updated by Giacomo Sanchietti over 4 years ago

To backport this feature we need to:
- update current release of duc (latest is 1.4.2)
- nethserver-restore-data: cherry-pick commits from master branch
- nethserver-duc: cherry-pick commits from master branch and handle database upgrade (duc database v1.0 and v1.4 are not compatible)

#5 Updated by Giacomo Sanchietti over 4 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

Re-based implementation on duc 1.4.2 both for NS 6 and NS 7.

#6 Updated by Giacomo Sanchietti over 4 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70

In nethserver-testing for NS 6:
- nethserver-restore-data-1.0.0-1.10.g2d7f331.ns6.noarch.rpm
- nethserver-duc-1.0.4-1.5.g0a72c89.ns6.noarch.rpm
- duc-1.4.2-1.ns6.x86_64.rpm

In nethserver-testing for NS 7:
- nethserver-restore-data-1.2.1-1.2.g4c8fad1.ns7.noarch.rpm
- nethserver-duc-1.4.0-1.1.g03606ff.ns7.noarch.rpm
- duc-1.4.2-1.ns7.x86_64.rpm

All test cases applies both to NS 6 and NS7.

Test case 1: clean install

- Install on a clean machine
- Configure a backup data and execute it
- Move the date forward by one day
- Execute the backup-data again
- Try to restore some data from the oldest backup

Test case 2: clean install

- Install on a clean machine
- Check the "Disk usage page" works correctly

Test case 3: update

- On a machine with old packages, configure a backup data and execute it
- Update the packages from texting
- Move the date forward by one day
- Execute the backup-data again
- Try to restore some data from the oldest backup

Test case 4: update

- Update a working machine
- Check that inside the "Disk usage" page all data are gone (the update removes the old duc.db)
- Hit the "Update" button
- Refresh the page
- Check the graphs is displayed correctly

#7 Updated by Filippo Carletti over 4 years ago

Test case 4: FAILED
When, after update, I click UPDATE in the empty Disk usage page I see a red error:
Task completed with errors
S20nethserver-duc-index #1 (exit status 256)
messages contains:

Dec 18 17:48:57 nscom esmith::event[26119]: Event: nethserver-duc-save
Dec 18 17:49:00 nscom esmith::event[26119]: Traceback (most recent call last):
Dec 18 17:49:00 nscom esmith::event[26119]:   File "/usr/share/duc/xml2json.py", line 184, in <module>
Dec 18 17:49:00 nscom esmith::event[26119]:     main()
Dec 18 17:49:00 nscom esmith::event[26119]:   File "/usr/share/duc/xml2json.py", line 179, in main
Dec 18 17:49:00 nscom esmith::event[26119]:     out = xml2json(input, options, strip_ns, strip)
Dec 18 17:49:00 nscom esmith::event[26119]:   File "/usr/share/duc/xml2json.py", line 152, in xml2json
Dec 18 17:49:00 nscom esmith::event[26119]:     return elem2json(elem, options, strip_ns=strip_ns, strip=strip)
Dec 18 17:49:00 nscom esmith::event[26119]:   File "/usr/share/duc/xml2json.py", line 129, in elem2json
Dec 18 17:49:00 nscom esmith::event[26119]:     size = recToDelete(child, a)
Dec 18 17:49:00 nscom esmith::event[26119]:   File "/usr/share/duc/xml2json.py", line 96, in recToDelete
Dec 18 17:49:00 nscom esmith::event[26119]:     size = int(elem.attrib['size'])
Dec 18 17:49:00 nscom esmith::event[26119]: KeyError: 'size'
Dec 18 17:49:00 nscom esmith::event[26119]: Action: /etc/e-smith/events/nethserver-duc-save/S20nethserver-duc-index FAILED: 1 [3.454196]
Dec 18 17:49:00 nscom esmith::event[26119]: Event: nethserver-duc-save FAILED

/var/cache/duc/duc.db seems good, I'm unsure about tree.xml but the syntax seems ok.

#8 Updated by Filippo Carletti over 4 years ago

Test case 3: OK
Notes:
  • I can select to restore only the last backup, i.e. the one made after the updates.
  • Advancing the date and running one more backup, I can select both backups.

#9 Updated by Filippo Carletti over 4 years ago

I can't replicate the error I had during test case 4 in a different system. Errors seem to be present only on that system.

#10 Updated by Filippo Carletti over 4 years ago

  • Status changed from ON_QA to TRIAGED
  • % Done changed from 70 to 20

/var/log/messages contains multiple lines like:

Dec 28 02:00:03 server esmith::event[6559]: /usr/bin/duc: unrecognized option '--min-size=0'
Dec 28 02:00:03 server esmith::event[6559]: Try 'duc --help' for more information.

They probably come from /etc/e-smith/events/actions/nethserver-restore-data-duc-index.

duc has changed syntax:

root@server ~]# duc xml -h | grep size
  -s,  --min_size=VAL        specify min size for files or directories

#11 Updated by Giacomo Sanchietti over 4 years ago

  • Status changed from TRIAGED to MODIFIED
  • % Done changed from 20 to 60

Fixed script syntax.

#12 Updated by Giacomo Sanchietti over 4 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:

  • nethserver-restore-data-1.0.0-1.12.g465a44a.ns6.noarch.rpm
  • nethserver-duc-1.0.4-1.6.g682e303.ns6.noarch.rpm

#13 Updated by Stefano Fancello over 4 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

#14 Updated by Giacomo Sanchietti over 4 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

Released for NS 6:
- duc-1.4.2-1.ns6.x86_64.rpm
- nethserver-duc-1.0.5-1.ns6.noarch.rpm
- nethserver-restore-data-1.0.1-1.ns6.noarch.rpm

Released for NS 7:
- duc-1.4.2-1.ns7.x86_64.rpm
- nethserver-duc-1.4.1-1.ns7.noarch.rpm

Also available in: Atom PDF