Skip to content
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

feat: take site_config backup #10765

Merged
merged 4 commits into from Jun 23, 2020
Merged

Conversation

sahil28297
Copy link
Contributor

Automatically take site_config backups and also upload to remote backup services if enabled.

Co-authored-by: Chinmay D. Pai <chinmaydpai@gmail.com>
Copy link
Collaborator

@revant revant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it works.

just for consistency naming can be changed.

  • all other files are datetime-site_name-file_type
  • also generally datetime is constant for all files generated, it generates some delayed datetime for this site_config file.
20200622_193706-docs_localhost-database.sql.gz
site_config_backup_20200622_193707.json

Shouldn't it be part of set_backup_file_name, todays_date is defined there already.

It defines todays_date in other method as well.

@mergify mergify bot merged commit aacf9e3 into frappe:develop Jun 23, 2020
@revant
Copy link
Collaborator

revant commented Jun 23, 2020

frappe/frappe_docker#282

@revant
Copy link
Collaborator

revant commented Jun 24, 2020

@Mergifyio backport version-12-hotfix version-11-hotfix

@mergify
Copy link
Contributor

mergify bot commented Jun 24, 2020

Command backport version-12-hotfix version-11-hotfix: failure

No backport have been created

  • Backport to branch version-12-hotfix failed

Cherry-pick of 2a303d0 has failed:

On branch mergify/bp/version-12-hotfix/pr-10765
Your branch is up to date with 'origin/version-12-hotfix'.

You are currently cherry-picking commit 2a303d0ffd.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:

	modified:   frappe/integrations/doctype/google_drive/google_drive.py
	modified:   frappe/integrations/offsite_backup_utils.py
	modified:   frappe/utils/backups.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)

	both modified:   frappe/integrations/doctype/dropbox_settings/dropbox_settings.py
	both modified:   frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py

  • Backport to branch version-11-hotfix failed

Cherry-pick of 2a303d0 has failed:

On branch mergify/bp/version-11-hotfix/pr-10765
Your branch is up to date with 'origin/version-11-hotfix'.

You are currently cherry-picking commit 2a303d0ffd.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)

	both modified:   frappe/integrations/doctype/dropbox_settings/dropbox_settings.py
	deleted by us:   frappe/integrations/doctype/google_drive/google_drive.py
	both modified:   frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py
	deleted by us:   frappe/integrations/offsite_backup_utils.py
	both modified:   frappe/utils/backups.py

no changes added to commit (use "git add" and/or "git commit -a")

@gavindsouza
Copy link
Collaborator

gavindsouza commented Jun 29, 2020

While running uninstall-app:

Backing up...
Traceback (most recent call last):
  File "/Users/gavin/.pyenv/versions/3.7.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/gavin/.pyenv/versions/3.7.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/bench_helper.py", line 99, in <module>
    main()
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/gavin/Desktop/frappe-bench-dev/env/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/gavin/Desktop/frappe-bench-dev/env/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/gavin/Desktop/frappe-bench-dev/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/gavin/Desktop/frappe-bench-dev/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/gavin/Desktop/frappe-bench-dev/env/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/gavin/Desktop/frappe-bench-dev/env/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/gavin/Desktop/frappe-bench-dev/env/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/commands/__init__.py", line 26, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/commands/site.py", line 433, in uninstall
    remove_app(app, dry_run, yes, no_backup)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/installer.py", line 132, in remove_app
    scheduled_backup(ignore_files=True)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/backups.py", line 212, in scheduled_backup
    odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force, verbose=verbose)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/backups.py", line 225, in new_backup
    odb.get_backup(older_than, ignore_files, force=force)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/backups.py", line 61, in get_backup
    last_db, last_file, last_private_file, site_config_backup_path = self.get_recent_backup(older_than)
  File "/Users/gavin/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/backups.py", line 115, in get_recent_backup
    return (backup_path_db, backup_path_files, backup_path_private_files, site_config_backup_path)
UnboundLocalError: local variable 'site_config_backup_path' referenced before assignment

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants