mirror of
https://github.com/frappe/bench.git
synced 2025-01-26 08:08:23 +00:00
fix backup in v4 to v5 upgrade
This commit is contained in:
parent
ae6d4eee99
commit
2d3ed01a2a
@ -232,11 +232,14 @@ def update(pull=False, patch=False, build=False, bench=False, auto=False, restar
|
|||||||
if pull:
|
if pull:
|
||||||
pull_all_apps()
|
pull_all_apps()
|
||||||
|
|
||||||
if requirements:
|
|
||||||
update_requirements()
|
|
||||||
|
|
||||||
if upgrade:
|
if upgrade:
|
||||||
pre_upgrade(version_upgrade[0], version_upgrade[1])
|
pre_upgrade(version_upgrade[0], version_upgrade[1])
|
||||||
|
import utils, app
|
||||||
|
reload(utils)
|
||||||
|
reload(app)
|
||||||
|
|
||||||
|
if requirements:
|
||||||
|
update_requirements()
|
||||||
|
|
||||||
if patch:
|
if patch:
|
||||||
if not no_backup:
|
if not no_backup:
|
||||||
|
@ -314,7 +314,7 @@ def backup_site(site, bench='.'):
|
|||||||
exec_cmd("{frappe} --backup {site}".format(frappe=get_frappe(bench=bench), site=site),
|
exec_cmd("{frappe} --backup {site}".format(frappe=get_frappe(bench=bench), site=site),
|
||||||
cwd=os.path.join(bench, 'sites'))
|
cwd=os.path.join(bench, 'sites'))
|
||||||
else:
|
else:
|
||||||
run_frappe_cmd('--site {site} backup'.format(site=site), bench=bench)
|
run_frappe_cmd('--site', site, 'backup', bench=bench)
|
||||||
|
|
||||||
def backup_all_sites(bench='.'):
|
def backup_all_sites(bench='.'):
|
||||||
for site in get_sites(bench=bench):
|
for site in get_sites(bench=bench):
|
||||||
@ -429,14 +429,16 @@ def run_frappe_cmd(*args, **kwargs):
|
|||||||
|
|
||||||
def pre_upgrade(from_ver, to_ver, bench='.'):
|
def pre_upgrade(from_ver, to_ver, bench='.'):
|
||||||
from .migrate_to_v5 import validate_v4, remove_shopping_cart
|
from .migrate_to_v5 import validate_v4, remove_shopping_cart
|
||||||
|
pip = os.path.join(bench, 'env', 'bin', 'pip')
|
||||||
if from_ver == 4 and to_ver == 5:
|
if from_ver == 4 and to_ver == 5:
|
||||||
apps = ('frappe', 'erpnext')
|
apps = ('frappe', 'erpnext')
|
||||||
remove_shopping_cart(bench=bench)
|
remove_shopping_cart(bench=bench)
|
||||||
|
|
||||||
for app in apps:
|
for app in apps:
|
||||||
cwd = os.path.join(bench, 'apps', app)
|
cwd = os.path.abspath(os.path.join(bench, 'apps', app))
|
||||||
if os.path.exists(cwd):
|
if os.path.exists(cwd):
|
||||||
exec_cmd("git clean -dxf", cwd=cwd)
|
exec_cmd("git clean -dxf", cwd=cwd)
|
||||||
|
exec_cmd("{pip} install --upgrade -e {app}".format(pip=pip, app=cwd))
|
||||||
|
|
||||||
def post_upgrade(from_ver, to_ver, bench='.'):
|
def post_upgrade(from_ver, to_ver, bench='.'):
|
||||||
from .app import get_current_frappe_version
|
from .app import get_current_frappe_version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user