At the new Phabricator version (currently deployed at phab-01.wmflabs.org) you can add subprojects. But there is one big disadvantage: You can not reorganize the current setting, for example, you have the normal projects a and b. You can not make b to a subproject of a. You have to create a new b as a subproject of a, and archive the old b.
But there is one alternative: You can change the DB to mark projects as subprojects: It's easy:
= Preperation =
* You need the PHID of the parent project.
* Are there already subprojects at this project? Otherwise you have to change another value. (Case B)
* Use the DB phabricator_project (you only need the table project at this database)
= The process =
* Get the existing data of the (future) subproject, you need this columns:
`mysql> SELECT name, projectPath, projectDepth, parentProjectPHID from project where name = '<Name of the project>';`
At my example I get the following content:
+-------------------+-------------+--------------+-------------------+
| name | projectPath | projectDepth | parentProjectPHID |
+-------------------+-------------+--------------+-------------------+
| Project_B | KXZN | 0 | NULL |
+-------------------+-------------+--------------+-------------------+
1 row in set (0.00 sec)
WARNING: `projectDepth` must have the value 0, otherwise this object is alerady a subproject (same at parentProjectPHID , this value have to be NULL)
* Adjust the needed values:
** Increase projectDepth: 0 => 1 (If you want to add this as a subproject of a subprohject you have to choose 2, etc)
** Set parentProjectPHID to the PHID of "headproject"
** ProjectPath: This part is a bit different. At first you need the projectPath from the "headproject":
For example:
+---------------+-------------+
| name | projectPath |
+---------------+-------------+
| Project_A | fwND |
+---------------+-------------+
1 row in set (0.00 sec)
So the path of the project is "fwND" in this example. For the subproject, you have to take the path of the project, and add the existing path of the subproject to it. (Project A - fwND; Project B - KXZN) Result: "fwNDKXZN"
Now you have to change these three values, after that the entry should look like this:
+-----------------+-------------+--------------+--------------------------------+
| name | projectPath | projectDepth | parentProjectPHID |
+-----------------+-------------+--------------+--------------------------------+
| Project_B | fwNDDWus | 1 | PHID-PROJ-i3ka2ejyihk6yqey4te2 |
+-----------------+-------------+--------------+--------------------------------+
1 row in set (0.00 sec)
If it is correct, you have a subproject now.
= Special Case B =
If the headproject did not have any subprojects yet, you have to change an additional value, for example:
+---------------+----------------+
| name | hasSubprojects |
+---------------+----------------+
| Project_A | 0 |
+---------------+----------------+
1 row in set (0.00 sec)
In this case you have to set the boolean "hasSubprojects" to 1, because you want that this project has subprojects now ;).