Restore doesn't work

Hi
I just made a clean install and everything was ok.
I restored my files (public,private,database) and ran bench update which gives :
Backup failed for Site boomstroy.com. Database or site_config.json may be corrupted

1 Like

Any help?
I can’t restore my previous setup’s data to a new site.

ERPNext (by default) creates a backup every 6 hours and places it in the directory:

/home/[USER]/frappe-bench/sites/[sitename]/private/backups

Try taking one of those to restore.

BKM

1 Like

Oh the great bkm :smiley:
As always thankyou for your help.
Yep, I have my backups on googledrive, thats not the issue.
we changed to a stronger VPS and i am trying to restore this clean install with my backups from before.

1 Like

Is the old system still running?

If so you can use the mysqldump commamd to do a brute force generic backup of the old date and move the dump file to the new one for restore.

This is the method I use for upgrades.

Do you need the syntax for that or do you have it already?

BKM

Just in case…

Here is the syntax that I use to run backups. It doesn’t care about what is in the site_config.json file of the old host:

mysqldump -u root -p[your-password] _1bd3e0294da88113 | gzip > /home/[USER]/backup/db_bkup.sql.gz

The " -p " is to indicate your mariadb password and it must go right up against the p with no spaces.

The long string that begins with the underscore is the database name. You can find yours in the old site_config.json of the original server

Replace [USER] with your server user name

In the case of the above synrtax, I have a subdirectory in my user directory called backup. You can change that to suit your needs.

The command generates a backup file that is already gzipped and ready for transport.

When it comes time to do the restore on the new system use the following syntax:

sudo bench --force --site [your.site.name] restore /path_to_sql_file

Hope your old system is still active and you can do something like this.

BKM

1 Like

Tnx for the reply.
Unfortunately it is not. So any other way I could use my current backup files?
But I used my files on frappecloud and it restored there.
I have all 4 (satabase,public,private and config)

Do you still have access to the frappe cloud?

If so, try restoring there and then taking a fresh backup from there to send to the new server.

Otherwise, possibly drop whatever database exists on the new server and then do a restore.

However, you need to prove to yourself that the backup file is still valid and not corrupted if at all possible. So if you have access to the frappe-cloud, restore it there to make sure it still works.

I do know that I once managed to corrupt a backup file during the process of moving it to another host. Fortunately, I still had the original server and pulled a fresh backup to try again. It seemed to happen when I transferred my backup to “Dropbox” and then from there to my server. I eventually had to stop using Dropbox because I couldn’t trust the state of the backup file.

BKM

There’s an issue with the v14-beta rejecting v13 site_config.json files under some circumstances that I haven’t been able to pinpoint. Could that be your situation?

https://github.com/frappe/frappe/issues/16728

In any case, I wouldn’t jump to the conclusion that your backup is corrupted. Try running the update without backups (bench update --no-backup) and see if it gets things up and running.

Tnx for your reply
well i am on 13 still so I don’t think thats the issue.

I’d still suggest trying the upgrade with the --no-backups flag.

The only other thing I could think of would be to:

  • Copy in the old site_config.json file as the first step
  • Restart the server
  • Then try restoring the old database
  • If successful, then run bench migrate

Other than that, it appears you may have a corrupted database backup.

BKM

Hi all
tnx for the replies.
Did a new install again, which i must say… I ran into so many errors and problems I don’t even remember how I got out.
but in the end new install is ok , but the funny thing is just running normal restore worked and all is good.