bench new-site
Usage
bench new-site [OPTIONS] SITE
Description
Create a new Frappe site. This operation creates a new folder under ./sites which will contain all the site information for the site and also creates a new database in your DBMS with all of Frappe's Modules and DocTypes installed.
The site config, which can be found under ./sites/{site}/site_config.json maintains information about the site's state. For more information about it, check out this guide.
If site creation fails due to any reason, you'll be prompted as to whether you'd like to rollback the changes made, which are the creation of the site directory, and the creation of a database and database user.
Options
--db-nameSet the Database name for new site - also used as the database username if not specified separate--db-userFrom v16 onwards, choose the database user name OR specify an existing user+password combination--db-passwordSet the Database password for new site, or password for existing specified database user.--db-typeSelect the Database Type for new site, options being "postgres" or "mariadb". Default is "mariadb"--db-hostSet Database Host for new site--db-portSet Database Port for new site--db-root-usernameSpecify Root username for MariaDB or Postgres--db-root-passwordSpecify Root password for MariaDB or Postgres--admin-passwordSpecify the Administrator password for new site--source_sqlInitiate database with a SQL file--install-appInstall app after installation
Flags
--no-mariadb-socketSet MariaDB host to % and use TCP/IP Socket instead of using the UNIX Socket--verboseAdd Verbosity--forceForce restore if the site or a database with the same name already exists
Examples
- Create a new site.
bench new-site {site}
- Create a new PostgreSQL site.
bench new-site {site} --db-type postgres
Create a new site while skipping the interactive prompts for
- Submitting the Site's Administrator Password
- Submitting the MariaDB Root Password
bench new-site {site} --admin-password {admin-password} --db-root-password {mariadb-password}
- Create a new site with non-default and autogenerated values.
bench new-site {site} --db-type {type}
--db-name {name}
--db-user {user}
--db-password {pass}
--db-host {host}
--db-port {port}
- Create a new site with a MariaDB non-root user with database creation privileges.
bench new-site {site}
--db-root-username {user}
--db-root-password {pass}
- Create a new site with an app (available on current bench) installed.
bench new-site {site} --install-app {app}