For some reason couldn’t get the files restored but the bench restore worked for the site itself.
bench --site site1.local --force restore sites/site1.local/private/backups/20221010_182909-site1_local-database.sql.gz
MySQL root password:
*** Scheduler is enabled ***
Site site1.local has been restored
Just not to make anything wrong, what is the best next step to try to look if the website would start running? (Of course it won’t have the files/images now)
Should be we make “bench update” first or just “bench restart”?
sudo service nginx reload
Job for nginx.service failed.
See "systemctl status nginx.service" and "journalctl -xe" for details.
Looked “systemctl status nginx.service” that says nginx is active and running and then this in the final lines (other lines look fine):
Oct 12 12:05:06 localhost systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Oct 12 12:05:06 localhost systemd[1]: Reload failed for A high performance web server and a reverse proxy server.
“journalctl -xe” lists different successes, nothing alerting there.
Removed lines of “chown” from the supervisor config and got the command "sudo bench production [username] slightly further. Error came in this part:
$ sudo systemctl reload supervisor
Setting Up NGINX...
nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Port configuration list:
Site site1.local assigned port: 80
Setting Up symlinks and reloading services...
$ sudo /usr/sbin/nginx -t
nginx: [emerg] duplicate upstream "frappe-bench-frappe" in /etc/nginx/conf.d/frappe.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
ERROR:
Traceback (most recent call last):
The command “sudo bench setup production [frappeuser]” fails:
- -
Site site1.local assigned port: 80
Setting Up symlinks and reloading services...
$ /usr/bin/supervisorctl reread
frappe-bench-redis: available
frappe-bench-web: available
frappe-bench-workers: available
$ /usr/bin/supervisorctl update
frappe-bench-redis: added process group
frappe-bench-web: added process group
frappe-bench-workers: added process group
$ sudo /usr/sbin/nginx -t
nginx: [emerg] duplicate upstream "frappe-bench-frappe" in /etc/nginx/conf.d/frappe.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
ERROR:
Traceback (most recent call last):
File "/usr/local/bin/bench", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.8/dist-packages/bench/cli.py", line 121, in cli
raise e
File "/usr/local/lib/python3.8/dist-packages/bench/cli.py", line 111, in cli
bench_command()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/bench/commands/setup.py", line 72, in setup_production
setup_production(user=user, yes=yes)
File "/usr/local/lib/python3.8/dist-packages/bench/config/production_setup.py", line 74, in setup_production
reload_nginx()
File "/usr/local/lib/python3.8/dist-packages/bench/config/production_setup.py", line 184, in reload_nginx
exec_cmd(f"sudo {which('nginx')} -t")
File "/usr/local/lib/python3.8/dist-packages/bench/utils/__init__.py", line 153, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError
Unfortunately this took months (huge loss in visibility and Google value) but now had a chance to look this matter again. We have installed frappe bench and erpnext as an app again. We put the files and database backups back. After that the website was still not visible.
Now we are very close!
With the command “sudo bench setup production our_bench-username” we got the website back! It is still visible only in IP address. We do have our domain in the site config. What else we need to do in order to show it from the domain name instead of only IP address?