Trying to restore a backup from site-a.com to site-b.com with no luck

Hi comrades,

I’m trying to restore a backup from https://site-a.com to https://site-b.com.

But when I type on the browser site-b.com it goes well on the first page, it shows with no problem on the address bar https://site-b.com, but when i click on login or any link, for example, it immediately redirects to the domain https://site-a.com.

I used these commands:

bench new-site site-b.com --install-app erpnext
bench --site site-b.com add-to-hosts
bench setup add-domain --site site-b.com www.site-b.com
sudo setup wildcard-ssl site-b.com
bench set-url-root site-b.com https://site-b.com
bench setup nginx
sudo service nginx reload

bench --site site-b.com restore /home/user/bench/sites/site-b.com/private/backups/20201215_201920-site-a_com-database.sql.gz --with-public-files /home/user/bench/sites/site-b.com/private/backups/20201215_201920-site-a_com-files.tar --with-private-files /home/user/bench/sites/site-b.com/private/backups/20201215_201920-site-a_com-private-files.tar

I think i missing a step. Or perhaps this is not the correct way to restore a site in a different domain.

Does anyone could please help me?

Thank you in advance.

Regards.

Looks like you missed setting up multi-tenancy. So the first site is being used by default.

What you’re looking for is DNS based multitenancy.

The documentation will go into a little more detail about this:

https://frappeframework.com/docs/user/en/bench/guides/setup-multitenancy

Thank you you Keneth,

Well I didn’t mentioned, the server was already on DNS Multitenancy, working with no problems with other 5 sites, running with Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-128-generic x86_64).
Bench version 5.2.1
Frappe 13.0.0-beta.8
Erpnext 13.0.0-beta.6

Regards,

Also the server is in production mode.

I will try to restore the backup on a FrappeCloud server.

How about the hostname value in frappe-bench/sites/sitename? Could that be the reason?

Thanks

Jay

Thank you Jay,

The hostname of the destination site is ok in /home/user/frappe-bench/sites/site-b.com
Also site_config.json has this config:
‘’’

“domains”: [
www.site-b.com”,
site-b.com
],
“host_name”: “https://site-b.com”,

‘’’

Regards