can’t confirm this is what actually happens. Getting an Exception: Database [database_name] already exits. instead. So there is at least one step missing in between.
bench backup (this creates a new file in /sites/my_site/private/backups)
delete a Sales Invoice in my ERPNext instance
`bench restore \path\to\backupfile.sql.gz
do you need to create new empty db first?
How would u practically do that?
this older Topic implies you could use a -f option but that does not seem to exist (anymore). So do you have to do that on a new site? If so, do you have to install erpnext to that site manually before restoring the database from the original site?
You don’t actually create a blank db, You just force your restore file to overwrite the existing one.
The only thing you have to make sure of with a new installation is that you have passed through the setup wizard on the first login using the Administrator user. Once that is done you can overwrite the database with any valid (and version compatible) erpnext backup.
can you elaborate on that? I would guess that this applies only if your database was envrypted to begin with. Proabably that would be the best practice I furthermore assume but I do not think by default this is the case?
You are not talkng about the mysql-root-password, right?
When you do backup and restore in the same server, I guess it’s okay, you might not need an encryption key.
But when you do backup and restore on another different server, encryption key is required in order to decrypt the database. some functions won’t work in ERPNext unless you replace your encryption key with the original one from your previous server.
You can follow up some discussions like this
many people didn’t know even such thing even existed until they encountered an error after restore, and by then it had been too late because the original encryption keys were already lost.
Is my understanding correct that this comes into play once you have setup an encrypted access (https) to the website you are serving your ERPNext instance to (like bench setup lets-encrypt [your_site]) ?
thx. In my current case there is nothing inside the site_config.json which looks like an encryption key.
I completely agree with you that backup & restore of that data needs to be included in a bench backup & bench restore routine. I wouldn’t even expect this to be too difficult to implement. I’d say we need to open an issue on github and a parallel a Topic here in the forum in order to promote that idea and get this fixed.