Rename the Site Directory
→ cd ~/frappe-bench/sites/
→ mv old_site_name new_site_name
Update the site_config.json File
→ Generally, you don’t need to change much here, but make sure the configuration aligns with the new site name if any entries refer to the old name.
→ nano ~/frappe-bench/sites/new_site_name/site_config.json
Update the Database Settings (Optional)
→ If you want to rename the database associated with the site (this step is optional), you will need to:
→ mysql -u root -p RENAME DATABASE old_site_name_db TO new_site_name_db;
→ Update db_name in the site_config.json to match the new database name:
{“db_name”: “new_site_name_db”}
If you are renaming the site in a production environment, ensure you take appropriate backups (files and database) before proceeding.
Renaming the site does not automatically rename the database, so if you prefer the database name to match the new site name, you’ll have to rename it manually as described.
If you’re running multiple sites and using a proxy (like nginx), you may also need to update your nginx configuration for the new site name.