On Havana, I moved some instances from one project to another via cli with command like:-
mysql> update nova.instances set project_id = 'xx00968bc4854852b87edbac32f4ff94' where reservation_id = 'r-00cw2es8';
This worked, but the project summaries are now wrong in both the source and destination projects.
I tried setting the in-use to -1 for the source project id, the sql update worked, but Horizon was broken and produced and error page for any requested url.
To fix this, I had to update the in_use column with the correct value (fortunately I had the original select * from quota_usages still on screen. However, just doing an update on the required resource updated multiple rows. After updating all the required resources, Horizon worked again. But now the totals were wrong as the multiple row updates were just all added together.
These rows needed adjusting manually including the id field in the update statement so the totals matched to actual usage values:-
mysql> update quota_usages set in_use='9' where project_id='xx7d3686c3f74eb28ea15cb659c8019e' and resource='cores' and id='93';
Query OK, 1 row affected (0.04 sec)
Rows matched: 1 Changed: 1 Warnings: 0
The destination project shows zero usage for new instances, so this will need adjusting manually too.