{"record":{"id":"ce8eaa309c7a5605","repo":"coollabsio/coolify","slug":"the-coolify-host-localhost-cannot-be-transferred-ce8eaa","errorCode":null,"errorMessage":"The Coolify host (localhost) cannot be transferred between instances.","messagePattern":"The Coolify host \\(localhost\\) cannot be transferred between instances\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ServerTransfer/ServerTransferMigrator.php","lineNumber":41,"sourceCode":"     *     export_id: string|null,\n     *     target_url: string,\n     *     import: array<string, mixed>,\n     *     complete: array<string, mixed>,\n     *     warnings: list<string>,\n     *     message: string\n     * }\n     */\n    public function migrate(\n        Server $server,\n        string $targetUrl,\n        string $targetToken,\n        bool $writeRemote = false,\n        bool $rebindSentinel = true,\n        bool $preserveUuids = true,\n        bool $adoptMode = true,\n    ): array {\n        if ($server->id === 0) {\n            throw new RuntimeException('The Coolify host (localhost) cannot be transferred between instances.');\n        }\n\n        $targetUrl = $this->normalizeTargetUrl($targetUrl);\n        $token = $this->normalizeToken($targetToken);\n\n        $bundle = $this->exporter->export($server, includeSensitive: true);\n        $exportId = data_get($bundle, 'export_id');\n        $warnings = array_values((array) data_get($bundle, 'warnings', []));\n\n        // Target import+claim runs in its own DB transaction on the remote instance.\n        // Source DB is unchanged until markTransferred below — so a failed remote import leaves source intact.\n        $importBody = $this->postImportToTarget(\n            targetUrl: $targetUrl,\n            token: $token,\n            bundle: $bundle,\n            writeRemote: $writeRemote,\n            rebindSentinel: $rebindSentinel,\n            preserveUuids: $preserveUuids,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferMigrator.php#L23-L59","documentation":"Error \"The Coolify host (localhost) cannot be transferred between instances.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferMigrator.php:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}