I recently tried to move my phabricator server to a new server. After I restored the sql dump and logged in with my username and password, I encountered the following message error:
AphrontSchemaQueryException
#1054: Unknown column 'task.spacePHID' in 'where clause'
Proof:
How can I fix this problem? Here are things I have done:
I thought there were probably changes to the table schema. I previously ran ./bin/storage upgrade already but I did it again to make sure, then I encountered this problem. This probably indicates that I cannot upgrade twice.
> ./bin/storage upgrade --force Applying patch 'phabricator:20150312.filechunk.1.sql'... [2015-11-02 05:38:14] EXCEPTION: (AphrontQueryException) #1050: Table 'file_chunk' already exists at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:311] arcanist(head=master, ref.master=baf5eb8a8795), phabricator(head=master, ref.master=b7a4d3b9a51c), phutil(head=master, ref.master=59f5a8d2bb82) #0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:275] #1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:181] #2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:6] #3 queryfx(AphrontMySQLiDatabaseConnection, string, string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:252] #4 PhabricatorStorageManagementAPI::applyPatchSQL(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:220] #5 PhabricatorStorageManagementAPI::applyPatch(PhabricatorStoragePatch) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:192] #6 PhabricatorStorageManagementUpgradeWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406] #7 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301] #8 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:176]
I checked the integrity of the backup by going to the mysql prompt and checking if the user table was good. The result is positive:
mysql> select id, phid, userName from user limit 3; +----+--------------------------------+-----------+ | id | phid | userName | +----+--------------------------------+-----------+ | 1 | PHID-USER-tik7zqm4tjgycrkzocm2 | admin | | 2 | PHID-USER-2bzm2mw24qqnyxxwk63f | yuanjian | | 4 | PHID-USER-lkcocaf5pmby4xpfqqpa | heqinghua | +----+--------------------------------+-----------+ 3 rows in set (0.00 sec)