Hi,
I’m trying to restore the database but getting
Exception: Database 1bd3e0294d already exists
bench restore my_data.sql
I also tried
bench -f restore
but no such command.
Can anyone tell me the command for restoring with existing database ?
You can use:
bench --site [sitename] --force restore /path/to/SQLFILE
Check this out for further info:
hi amruthp,
Another method is:
You login into mariadb, then manually remove your database 1bd3e0294d, then restore again.
Hi @adityaduggal and @chung_yan_Cheng , I did both methods
First,
executed the command,
bench --site site1.local --force restore 20160214_38705482_database.sql
Result
sh: 1: cannot open 20160209_22995063_database.sql: No such file
- I tried mysql way of restoring
mysql -u root -pUWf3qJCsZy 1bd3e0294d < 20160214_38705482_database.sql
after this my site is showing internal server error
http://161.202.162.235/
is there anything I’m doing wrong ?
Also note that I have downloaded the backup from frappe cloud.
Since you are saying that you have downloaded the backup from frappe cloud did you run:
bench --site [sitename] remove-from-installed-apps frappe_subscription
and then run bench --site [sitename] migrate
Just now I got it working, thanks. Yes I had tried removing frappe_subscription. I don’t think I did something wrong. the restore command is unable to parse the sql. something is broken there.
I got it working by doing a little hack,
> mysql -u root -pUWf3qJCsZy 1bd3e0294d < 20160214_38705482_database.sql
> bench remove-from-installed-apps frappe_subscription
> bench remove-from-installed-apps mandrill_integration
> bench migrate
There is some problem with bench --force restore. I tried it on two machines Ubuntu 14 TLS 64-bit, it doesn’t seem to work
@rmehta @pdvyas should look into it once.