New site DNS based multi-tenancy is not using new database

Hello,

I’ve created a second new site using with DNS based multitenancy but when i login to the new site it seems to still using my old site database.

Here is the new site config.json :

“db_name”: “0498c84c23fdf8cd”,
“db_password”: “XXXXXXXXXXXXXXX”,
“domains”: [
newsite.com
],
“encryption_key”: “XXXXXXXXXXXXXXXXXXXXXXXXXXc=”,
“nginx_port”: 443,
“ssl_certificate”: “/etc/letsencrypt/live/newsite.com/fullchain.pem”,
“ssl_certificate_key”: “/etc/letsencrypt/live/newsite.com/privkey.pem”

Here is the old site config.json :

“db_name”: “1bd3e0294da19198”,
“db_password”: “XXXXXXXXXXXXXXXXXXX”,
“domains”: [
{
“domain”: “oldsite.com”,
“ssl_certificate”: “/etc/letsencrypt/live/erpnext.deepit.be/fullchain.pem”,
“ssl_certificate_key”: “/etc/letsencrypt/live/erpnext.deepit.be/privkey.pem”
}
],
“encryption_key”: “XXXXXXXXXXXXXXXXXXXXXXXX=”,
“limits”: {
“space_usage”: {
“backup_size”: 5.0,
“database_size”: 18.71,
“files_size”: 3.0,
“total”: 26.71
}
},
“nginx_port”: 444,
“ssl_certificate”: “/etc/letsencrypt/live/oldsite.com/fullchain.pem”,
“ssl_certificate_key”: “/etc/letsencrypt/live/oldsite.com/privkey.pem”

I’ve used bench setup nginx and then restart nginx correctly.

I can acces the newsite but it’s using my old database. I want to use the newsite with a new database.

I’ve reinstalled the new site with " bench --site [sitename] --force reinstall " to restart with a fresh database but the newsite is still pointing the oldsite database

Any help would be appreciated

you have to setup again, nginx and supervisor and restart their services.

I’ve done it again, still pointing to the old database

i faced the same issue, and resolved it with following commands.

bench config dns_multitenant on
bench setup nginx
sudo service nginx reload

It’s not working in my case :frowning:

bench config dns_multitenant off
bench setup nginx
sudo service nginx restart

bench config dns_multitenant on
bench setup nginx
sudo service nginx restart

try this

Still the same issue sadly

it means you are missing the following command.

sudo cp /home/frappe/frappe-bench/config/nginx.conf /etc/nginx/sites-available/default

try this and
run these commands

Not working :frowning:

Have you found the solution for this? @nasrumed