Creating and restoring backup - instructions from wiki are not clear for me

I ended messing up the mysql due to other program on a Ubuntu Server, Now I would like to do a fresh install of Ubuntu, but without losing the information of the ERP that was working.

May anyone give me the instructions to do that? I’ve read that I can extract backups from the eRP interface, but I can’t login anymore, so I would have to do that just by the command line. What are the files that I have to save?

I’m trying to understand these instructions (Restoring From ERPNext Backup · frappe/erpnext Wiki · GitHub) but they are very sparse. In particular. where are located the files [DATABASE BACKUP FILE URL] and [FILES BACKUP FILE URL]? May anyone give me more detailed instructions?

I am using Frappe/Bench.

[I created the same top in the section “issues” of GitHub - I’m not sure about which is the correct one]

EDIT: OK, I guess I figured out: the DB backup is located at frappe-bench/sites/[site]/private/backup and the files are just the folder frappe-bench/sites/[sites]/public/files/.
So I did a fresh Ubuntu install. I’m trying to restore the previous database. When I run, I get a message that ends with the following error:

raise Exception("Database %s already exists" % (db_name,))

Exception: Database site1.local already exists

The problem is obvious, I just don’t really know what’s the recommended procedure now. What should I do next?

If you run bench frappe --restore db_name path/to/sql/file -f site_name , it will force restore the database.