Bug 21903 - koha-dump be able to include koha-upload
Summary: koha-dump be able to include koha-upload
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Matthias Meusburger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-28 15:40 UTC by Hugo Agud
Modified: 2019-10-17 13:14 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21903: koha-dump can export uploaded and temporary uploaded files (3.22 KB, patch)
2019-04-24 08:08 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 21903: koha-dump can export uploaded and temporary uploaded files (3.24 KB, patch)
2019-04-26 08:57 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 21903: koha-dump can export uploaded and temporary uploaded files (3.63 KB, patch)
2019-10-03 10:02 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 21903: koha-dump can export uploaded and temporary uploaded files (3.67 KB, patch)
2019-10-08 08:23 UTC, Hugo Agud
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hugo Agud 2018-11-28 15:40:05 UTC
At this moments koha-dump include configuration files and mysql database, but it is not including a backup of /uploads, it should be great if we can add n option to also backup the uploaded files
Comment 1 Matthias Meusburger 2019-04-24 08:08:33 UTC
Created attachment 88598 [details] [review]
Bug 21903: koha-dump can export uploaded and temporary uploaded files

Test plan:
 - Apply the patch
 - Try using koha-dump without any option
 - Try using koha-dump with --uploaded_files
 - Try using koha-dump with --uploaded_temp_files
 - Try using koha-dump with both of the options above

Expected results: the .tar.gz dump will include uploaded and/or temporary
uploaded files if requested.
Comment 2 Matthias Meusburger 2019-04-26 08:57:44 UTC
Created attachment 88867 [details] [review]
Bug 21903: koha-dump can export uploaded and temporary uploaded files

Sponsored-by: Orex

Test plan:
 - Apply the patch
 - Try using koha-dump without any option
 - Try using koha-dump with --uploaded_files
 - Try using koha-dump with --uploaded_temp_files
 - Try using koha-dump with both of the options above

Expected results: the .tar.gz dump will include uploaded and/or temporary
uploaded files if requested.
Comment 3 Hugo Agud 2019-08-20 09:33:16 UTC
I am testing the patch, and it is not working, it is not accepting the options, it only works the koha-dump <<instance>>
Comment 4 Katrin Fischer 2019-08-20 11:36:44 UTC
(In reply to Hugo Agud from comment #3)
> I am testing the patch, and it is not working, it is not accepting the
> options, it only works the koha-dump <<instance>>

Hi Hugo, what was the command that didn't work and what the error you received?

I think you always need to give the instande + options you want to use.
Comment 5 Hugo Agud 2019-08-20 15:25:02 UTC
I have tested all options

sudo koha-dump --uploaded_files kohadev

sudo koha-dump kohadev --uploaded_files

Dumping Koha site kohadev:
* DB to /var/spool/koha/kohadev/kohadev-2019-08-20.sql.gz
* configs, logs to /var/spool/koha/kohadev/kohadev-2019-08-20.tar.gz
Done.
grep: unrecognized option '--uploaded_files'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Error: Invalid instance name --uploaded_files

perhaps is the path where I should launch it,

/home/vagrant/kohaclone? or another?
Comment 6 Matthias Meusburger 2019-08-29 09:49:41 UTC
I don't know about vagrant, but on a regular debian packages-based install, once the following files are patched:

/usr/sbin/koha-dump
/usr/share/koha/bin/koha-functions.sh

I can run the backup using the following command:

# koha-dump --uploaded_files koha
Dumping Koha site koha:
* DB to /var/spool/koha/koha/koha-2019-08-29.sql.gz
* configs, files, logs to /var/spool/koha/koha/koha-2019-08-29.tar.gz
Done.

Notice the difference between our messages:
yours: configs, logs to
mine: configs, files, logs to

The "files" part is added by the patch, so I'm guessing you're executing an unpatched version of koha-dump.
Comment 7 Brendan Gallagher 2019-10-02 12:40:16 UTC
Just a note here for those that are using Vagrant installs (kohadevbox) you need to run reset_all for the /usr/sbin/koha-dump  and /usr/share/koha/bin/koha-functions.sh to get the updated flags. 

After that I get matching messages for regular koha-dump:

Dumping Koha site kohadev:
* DB to /var/spool/koha/kohadev/kohadev-2019-10-02.sql.gz
* configs, files, logs to /var/spool/koha/kohadev/kohadev-2019-10-02.tar.gz
Done.

But at last after I try to run the koha-dump --uploaded_files kohadev
(I get) Error: invalid option switch (--uploaded_files)

SO maybe I am wrong and this needs to be tested on a regular debian package.  (I'll ping Tomas and see if he understands a little more about the vagrant installs).
Comment 8 Matthias Meusburger 2019-10-03 09:59:39 UTC
Thanks for the feedback. My bad, I somehow messed up when submitting the patch. It should be ok now.
Comment 9 Matthias Meusburger 2019-10-03 10:02:06 UTC
Created attachment 93550 [details] [review]
Bug 21903: koha-dump can export uploaded and temporary uploaded files

Sponsored-by: Orex

Test plan:
 - Apply the patch
 - Try using koha-dump without any option
 - Try using koha-dump with --uploaded_files
 - Try using koha-dump with --uploaded_temp_files
 - Try using koha-dump with both of the options above

Expected results: the .tar.gz dump will include uploaded and/or temporary
uploaded files if requested.
Comment 10 Hugo Agud 2019-10-08 08:23:30 UTC
Created attachment 93862 [details] [review]
Bug 21903: koha-dump can export uploaded and temporary uploaded files

Sponsored-by: Orex

Test plan:
 - Apply the patch
 - Try using koha-dump without any option
 - Try using koha-dump with --uploaded_files
 - Try using koha-dump with --uploaded_temp_files
 - Try using koha-dump with both of the options above

Expected results: the .tar.gz dump will include uploaded and/or temporary
uploaded files if requested.

Signed-off-by: Hugo Agud <hagud@orex.es>
Comment 11 Magnus Enger 2019-10-17 13:14:18 UTC
Looks like this should be SO.