@title Upgrading Schema @group config This document describes how to upgrade the database schema. = Prerequisites = This document assumes you've already initialized the MySQL database and configured your Phabricator environment. If you haven't, see @{article:Configuration Guide}. = Loading patches = If you are doing this for the first time to a freshly installed MySQL database, run the following command: PHABRICATOR_ENV= path/to/phabricator/scripts/sql/upgrade_schema.php -v 0 This will install all the patches starting from 0. Running this script will store the information of the latest installed patch in the Phabricator database. Next time you want to upgrade your schema, just run: PHABRICATOR_ENV= path/to/phabricator/scripts/sql/upgrade_schema.php This will install all the patches that are new since the last time you ran this script. If your configuration uses an unprivileged user to connect to the database, you may have to override the default user so the schema changes can be applied with root or some other admin user: PHABRICATOR_ENV= path/to/phabricator/scripts/sql/upgrade_schema.php -u -p If you need to upgrade the schema starting from a specific patch, just run: PHABRICATOR_ENV= path/to/phabricator/scripts/sql/upgrade_schema.php -v However, this isn't usually needed.