Moving a Domain Between Companies - edmozley/freeitsm GitHub Wiki
Moving a domain between companies
(#384, proposed and built by @cloudcogsio. Multi-company installs only - with one company none of this appears.)
A domain's company used to be fixed when it was added, so one filed under the wrong client - or added through the REST API without a company, landing in the default one - stayed there. Now it can be moved.
Moving one
Open the domain and click Move, beside Edit. Pick the company and click Move again.
- You can only move a domain into a company you can reach yourself.
- The domain's internal view and its subdomains move with it: they cannot be in a different company from it. The dialog names them before you confirm.
- A subdomain is not moved on its own - move its parent, and it comes along. Subdomains have no Move button for that reason.
- History, findings, endpoints, expected records and certificates go with it, and each moved record's history says where it moved.
What is cleared
Three things on a domain belong to its company. When the new company does not have them they are cleared, the message after the move names them, and the history records each one:
- the registrar account;
- the cost centre;
- the customer person.
Everything else stays: status, owner, contacts, suppliers, tags, and links to knowledge articles and Service Status services.
When a move is refused
Nothing moves, and the message says why, when:
- the new company already has the same name in the same scope (Public or Internal) - delete or rename one of them first;
- the domain is linked to tickets or CMDB objects - links stay inside one company, so unlink them on the domain's Links tab first;
- the domain is linked to a contract - a contract belongs to one company, so remove it from the domain first.
These need a person's decision rather than a guess, so the move stops instead of unlinking anything for you.
Through the REST API
POST /domains/{id}/move-to-company with {"company_id": 3}. The key must reach both companies. The reply is the domain, plus moved (records moved; 0 if it was already there), moved_ids and cleared. PATCH /domains/{id} refuses a different company_id with a 422 naming this endpoint, instead of silently ignoring it. See REST API - Domains.
Related: Domains · Moving a domain - Developer Guide · Moving an asset · Moving a task