Gettng Encryption key is invalid! Error

Due to some unknown reasons my Production setup of ERPNext had stopped working.

In a frenzy to get it up and running quickly I backed up using the command bench --site {site} backup. Then I downloaded the backup using SSH.

After that I reinstalled Ubuntu Server and followed the installation process.

After successful installation process I first logged in to the system and then I use the command sudo bench --force --site {site} restore /data_backup.sql.

Then I issued the command bench migrate.

I managed to login and everything seemed to work fine but as soon as I tried to add a PO I got this error message.

In the backup that I downloaded there is file with a long name xxx-xxx-xxx-site_config_backup.json.

This file seems to contain some encryption keys.

Where and how to set/apply these encryption keys?

How to resolve this?

@yogeshvachhani copy the key to your new bench/sites/site_name/site_config.json

@bahaou thanks for the info but the name of database and MySQL password does not match in the file that is currently existing there and in the backup file.

Will that do or should I just copy the "encryption_key"?

@yogeshvachhani just the key

1 Like