-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add restoredb command #57
Conversation
Codecov Report
@@ Coverage Diff @@
## master #57 +/- ##
==========================================
- Coverage 93.84% 92.61% -1.23%
==========================================
Files 13 14 +1
Lines 763 826 +63
Branches 126 135 +9
==========================================
+ Hits 716 765 +49
- Misses 32 43 +11
- Partials 15 18 +3
Continue to review full report at Codecov.
|
68f41cf
to
b788821
Compare
Tested by file (not by folder) with success. Thanks, 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional review! LGTM
@lmignon is this ready to merge? |
@GSLabIt IMO yes it is. I'll resolve the conflicts into the next days |
82f8529
to
23900a2
Compare
ce3cebf
to
13b5ada
Compare
13b5ada
to
67d56f2
Compare
@sbidoul any news on this? ready to merge? thx |
hi all, any chance to get this merged? thx |
@GSLabIt thank you for the reminder. This PR will be merged into the next weeks... we're a bit overloaded at the moment which leaves us little time to finalize the various reviews in progress. |
@lmignon thx for the feedback, looking forward for the merge. |
Raises error in Odoo 10.0 Traceback (most recent call last):
File "/home/voronin/.local/share/virtualenvs/sintez_addons-7QRHjYmJ/lib/python2.7/site-packages/click_odoo/env_options.py", line 218, in _invoke
return self.org_invoke(ctx)
File "/home/voronin/.local/share/virtualenvs/sintez_addons-7QRHjYmJ/lib/python2.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/voronin/.local/share/virtualenvs/sintez_addons-7QRHjYmJ/lib/python2.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/voronin/.local/share/virtualenvs/sintez_addons-7QRHjYmJ/src/click-odoo-contrib/click_odoo_contrib/restoredb.py", line 109, in main
_restore_from_file(dbname, backup, copy)
File "/home/voronin/.local/share/virtualenvs/sintez_addons-7QRHjYmJ/src/click-odoo-contrib/click_odoo_contrib/restoredb.py", line 54, in _restore_from_file
odoo.service.db.restore_db(dbname, backup_file, copy)
File "/home/voronin/.local/share/virtualenvs/sintez_addons-7QRHjYmJ/lib/python2.7/site-packages/odoo/service/db.py", line 262, in restore_db
if odoo.tools.exec_pg_command(pg_cmd, *pg_args):
File "/home/voronin/.local/share/virtualenvs/sintez_addons-7QRHjYmJ/lib/python2.7/site-packages/odoo/tools/misc.py", line 123, in exec_pg_command
rc = subprocess.call(args2, env=env, stdout=dn, stderr=subprocess.STDOUT)
File "/usr/lib/python2.7/subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
TypeError: coercing to Unicode: need string or buffer, file found``` |
Thank you @voronind for the report. Unfortunately, it is very difficult to start investigating a potential problem with only a stack-trace 😏 Can you provide more information on how you use the script. On my side, I've been using it without any problem for months also on Odoo 10. Regards |
I try restore Odoo Postgres Dump (not Zip with files). And AFAIK
`odoo.tools.exec_pg_command` get file object instead of string with file
path.
чт, 27 авг. 2020 г. в 10:41, Laurent Mignon (ACSONE) <
[email protected]>:
… Raises error in Odoo 10.0
Thank you @voronind <https://github.com/voronind> for the report.
Unfortunately, it is very difficult to start investigating a potential
problem with only a stack-trace 😏 Can you provide more information on
how you use the script. On my side, I've been using it without any problem
for months also on Odoo 10.
Regards
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMBIUQ7IRN2VAS7XJPKOJ3SCX5Y3ANCNFSM4I7Z7TPQ>
.
|
|
||
def _restore_from_file(dbname, backup, copy=True): | ||
with db_management_enabled(), open(backup, "rb") as backup_file: | ||
odoo.service.db.restore_db(dbname, backup_file, copy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odoo 10 wants file path here? Not file object.
@voronind there is probably a misunderstanding in the way of using the script. The input must be a path to an Odoo backup zip file or a path to a backup directory created by the click-odoo-backupdb command. |
Then I request feature. Restore Odoo backup dump file. |
@voronind You're welcome to contribute to this PR |
Hi guys what's the status of this ? |
Hi folks, sorry for the delay with this PR. I hope come back to it in the next month or so, unless @lmignon beats me to it :) |
67d56f2
to
d75255f
Compare
Codecov Report
@@ Coverage Diff @@
## master #57 +/- ##
==========================================
- Coverage 94.15% 92.62% -1.54%
==========================================
Files 13 14 +1
Lines 770 827 +57
Branches 127 135 +8
==========================================
+ Hits 725 766 +41
- Misses 31 43 +12
- Partials 14 18 +4
Continue to review full report at Codecov.
|
Rebased. If green tomorrow I'll merge and release. |
For consistency with backupdb.
@rousseldenis @voronind I'm going to release this as is, I think it is good enough. If you have identified issues or missing feature, can you please open separate issues to discuss them ? |
@sbidoul pip package will be released as well? |
The release is on it's way to PyPI, as soon as travis catches up: https://travis-ci.com/github/acsone/click-odoo-contrib/builds/187542839 |
fixes #32
includes #58