Access denied when backup restore site

i get

when backup - restore with this step:

  1. backup with file: bench --site oldsite.com backup --with-files
  2. create new site
  3. restore:
    bench --site newsite.come restore ./oldsite.com/private/backups/20240715_2046
    53-oldsite_com-database.sql.gz --with-public-files ./oldsite.com/private/backups/20240715_204653-oldsite_com-files.tar --with-private-files ./oldsite.com/private/backups/20240715_204653-oldsite_com-private-files.tar
  4. copy content of 20240715_204653-oldsite_com-site_config_backup.json into site_config.json of newsite.com
  5. drop oldsite.com
  6. restart and get above err

Is “_4f1d7ff353dd3c35” the database name of the old site or the new site. Notice the site config does not contain a username for the DB (it’s the same as the db name).

I think step 4. is where your issue occurs. I believe in step 2 you’ll see your DB name in site config. Create a backup of this file. When you restore the backup it will restore into newsite.com’s database’s name (which will be different than oldsite.com’s DB. In step 4. don’t replace the DB name or password for new site, just make changes to other lines that are required. The restoration doesn’t rename the database to the old sites DB (you’d have a name conflict if it did since old site db still exists).

tks, it work