Description: dsconf tool now has: 'dsconf backup create' and 'dsconf backup restore'; 'dsconf localhost backend import' and 'dsconf localhost backend export'.
https://pagure.io/389-ds-base/issue/49858
Reviewed by: ?
It is a CLI part. I will add a Web/UI part next thing.
For UI part, the backup and restore should be dynamic under the instance "Actions" button dropdown. If the server is running, do the backup/restore via dsconf, if the server is stopped use dsctl. Fyi :-)
Reviewing patch now...
LGTM
Hey mate I think this looks excellent but, you are missing test cases.
It's possible to test the CLI framework, and I think especially for backup/import etc, it's critical that we have tests and assertions of it's correctness.
Can you please add tests for this?
Thanks!
Multiple arguments support was added. Everything works manually with CLI.
Also I've added some basic tests. Import-export passes but backup-restore currently fails with this:
[14/Aug/2018:08:33:51.958866540 -0400] - ERR - dblayer_backup - Log archive error
here ldap/servers/slapd/back-ldbm/dblayer.c:
5937 /* repeat this until the logfile sets match... */ 5938 do { 5939 /* get the list of logfiles currently existing */ 5940 if (priv->dblayer_enable_transactions) { 5941 return_value = LOG_ARCHIVE(priv->dblayer_env->dblayer_DB_ENV, 5942 &listA, DB_ARCH_LOG, (void *)slapi_ch_malloc); 5943 if (return_value || (listA == NULL)) { 5944 slapi_log_err(SLAPI_LOG_ERR, 5945 "dblayer_backup", "Log archive error\n"); 5946 if (task) { 5947 slapi_task_log_notice(task, "Backup: log archive error\n"); 5948 } 5949 return_value = -1; 5950 goto bail; 5951 } 5952 } else { 5953 ok = 1; 5954 }
So it looks like there is something wrong with the log or database filenames...
Actually, the CLI lib389 tests don't work at all in the current state. Nobody was supporting them while adding new parts in lib389/CLI. The setup fails and the logging doesn't work properly.
So as long as the CLI feature I add works manually, I think it is okay to rework current test suite later. I need to continue with other CLI/WebUI work first...
rebased onto 68de588177a664860b74da071a70cbbf4142efe7
@spichugi I think we should work out why these tests are failing first, because backup and restore are critical to administrative trust in upgrades and rollbacks. We need to guarantee we never have issues in this area because this is possibly the most critical interface for supportability.
Can we work out why these are failing?
@spichugi I think we should work out why these tests are failing first, because backup and restore are critical to administrative trust in upgrades and rollbacks. We need to guarantee we never have issues in this area because this is possibly the most critical interface for supportability. Can we work out why these are failing?
The DS tasks itself work. And CLI/WebUI parts also work (manually). But our testing topologies and the tests itself for CLI don't work (one error I've posted above, also we have issues with JSON and other optional args in FakeArgs).
for CLI
So we need to rethink the CLI testing infrastructure and I don't want to do it in rush. I will create a separate issue for this. And any contributions are welcome :)
rebased onto 75c199ac2fdead5da628f6bf6fb504044c06e2e3
Added a new commit. Please, review
For "export/import" in the UI, when you right click on a suffix node, that suffix should be autopopulated in the modal. In fact you should not be allowed to change it (you can not specify a subtree). So it should either be in the title or the root suffix field should be read-only.
Making the modal size dynamic has also broken other modals layouts that were expecting it to be a fixed size: new local password policy, and reload schema files from actions menu(?)
Not sure if it's related but the "Create Winysnc Agreement", "Create SASL Mapping", "Add CA Cert", "Import Cert", etc modals are on the far left of the screen.
2 new commits added
Issue 49858 - Add WebUI part for online backup/restore and import/export
Issue 49858 - Add backup/restore and import/export functionality to CLI
For "export/import" in the UI, when you right click on a suffix node, that suffix should be autopopulated in the modal. In fact you should not be allowed to change it (you can not specify a subtree). So it should either be in the title or the root suffix field should be read-only. Yes, I agree.
For this, we should have the functioning db-tree but it is just an HTML template now (with hard-coded field 'id's. I think it is better to implement the feature in the separate PR because it will be bigger than a couple of lines and my PR is already big enough. Probably we will use jstree here... I did implement my current part with this idea in mind. So when we'll be implementing our db-tree we can just replace (remove) existing 'Root suffix' field with something dynamic. The rest of the import/export logic won't change. I left 'TODO' comment in the place where we should work out the issue after implementing db-tree.
db-tree
jstree
Making the modal size dynamic has also broken other modals layouts that were expecting it to be a fixed size: new local password policy, and reload schema files from actions menu(?) Not sure if it's related but the "Create Winysnc Agreement", "Create SASL Mapping", "Add CA Cert", "Import Cert", etc modals are on the far left of the screen.
I really think we should have dynamic sized fields. I did remove the CSS change for now. We can work it out later. I'll create a bunch of tickets for all of the issues mentioned in this PR.
P.S. Actually, I think it will be enough to remove ds-modal-wide and ds-modal. I did it for Create SASL Mapping and it looks good on my machine. We should check why you were not happy with it...
I did it for Create SASL Mapping and it looks good on my machine. We should check why you were not happy with it... Not sure if it's related but the "Create Winysnc Agreement", "Create SASL Mapping", "Add CA Cert", "Import Cert", etc modals are on the far left of the screen.
I did it for Create SASL Mapping and it looks good on my machine. We should check why you were not happy with it...
These are not centered on the screen (they are on the left edge of the screen), are they centered for you?
I did it for Create SASL Mapping and it looks good on my machine. We should check why you were not happy with it... Not sure if it's related but the "Create Winysnc Agreement", "Create SASL Mapping", "Add CA Cert", "Import Cert", etc modals are on the far left of the screen. These are not centered on the screen (they are on the left edge of the screen), are they centered for you?
Before my PR they were centered but "Manage Backups" were not centered and went off the right side of the screen. https://pagure.io/389-ds-base/blob/master/f/src/cockpit/389-console/index.html#_291
I changed ds.css ds-modal-wide to the automatic recenter (instead of hardcoded pixels) and it has started to work for me well
But "Create SASL Mapping" went off the screen because of this as you noticed :)
If I remove ds-modal-wide from here https://pagure.io/389-ds-base/blob/master/f/src/cockpit/389-console/servers.html#_1008 "Create SASL Mapping" works well for me and centered.
So I want to open another issue where we can resolve all of the wrong alignments. My initial thought was to remove ds-modal and ds-modal-wide because existing cockpit models works okay without it. But if it doesn't work for you we should modify it then so they'll be automatic and flexible. :)
Okay, this gets my ack, but if you can get into a single commit that would be nice.
rebased onto c393394f8ba7d057b6a252b8844fe05b56e162e4
Pull-Request has been merged by spichugi
@spichugi Hey mate, I know you finished and merged this, but would it be possible to more assertions after you do the restore? Like search for some items or check the configuration is still the same as it was?
Sure, I'll add it :) Thanks!
No thank you! This is really exciting to see you contributing so much more to the project, and I hope my feedback is helping. I look forward to reviewing the next part.
389-ds-base is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in 389-ds-base's github repository.
This pull request has been cloned to Github as issue and is available here: - https://github.com/389ds/389-ds-base/issues/2959
If you want to continue to work on the PR, please navigate to the github issue, download the patch from the attachments and file a new pull request.
Thank you for understanding. We apologize for all inconvenience.
Pull-Request has been closed by spichugi
Description: dsconf tool now has:
'dsconf backup create' and 'dsconf backup restore';
'dsconf localhost backend import' and 'dsconf localhost backend export'.
https://pagure.io/389-ds-base/issue/49858
Reviewed by: ?