Bench backup issue after changing site.local to example.com

I have changed site name from default (site1.local) to some random name like example.com with all configuration needed and site works fine with that domain name.

But when i am trying to run backup using “bench backup --with-files” its showing me below errors:

Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 895, in backup
frappe.init(site=site)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 121, in init
local.conf = _dict(get_site_config())
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 175, in get_site_config
raise IncorrectSitePath, “{0} does not exist”.format(site_config)
frappe.exceptions.IncorrectSitePath: 404: Not Found

Renaming the site from site.example.com to site1.local resolved that issue but i need to make the site as example.com to correct sales order showing that site.local links and to make custom name.

Could someone suggest me how i can do this ?

Add a host_name property to site_config.json and set it to the domain you want to use

Eg :

"host_name":example.com

I have already tried that modification by adding hostname entry to point to my domain and restart nginx and bench processes but its still not works.

Try running bench setup nginx and see if that works?

Shouldn’t cause problems. Check if site_config.json exists at sites/example.com/site_config.json

@vjFaLk @anand,

Thanks for your reply.

I have tried “bench setup nginx” command and it works with no error, but i am still facing same error using “bench backup --with-files”

@anand, yes i have site_config.json with “host_name”:“example.com” configuration and backup works fine if i renamed it back to site.local.