{"record":{"id":"cc240931c1fe4079","repo":"coollabsio/coolify","slug":"the-coolify-host-localhost-cannot-be-transferred","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/ServerTransferExporter.php","lineNumber":79,"sourceCode":"        'deleted_at',\n        'environment_id',\n        'destination_id',\n        'destination_type',\n        'source_id',\n        'source_type',\n        'private_key_id',\n        'additional_servers_count',\n        'additional_networks_count',\n        'server_status',\n    ];\n\n    /**\n     * @return array<string, mixed>\n     */\n    public function export(Server $server, bool $includeSensitive = true): array\n    {\n        if ($server->id === 0) {\n            throw new RuntimeException('The Coolify host (localhost) cannot be transferred between instances.');\n        }\n\n        $server->loadMissing(['settings', 'privateKey', 'standaloneDockers', 'swarmDockers', 'cloudProviderToken', 'sslCertificates']);\n\n        $privateKey = $server->privateKey;\n        if (! $privateKey instanceof PrivateKey) {\n            throw new RuntimeException('Server has no private key to export.');\n        }\n\n        if (! $includeSensitive) {\n            throw new RuntimeException('Server transfer export requires sensitive data access (read:sensitive).');\n        }\n\n        // applications() also includes multi-destination attachments on this server;\n        // unique by id so a multi-dest app is only considered once for validation/export.\n        $applications = $server->applications()->unique('id')->values();\n        $databases = collect($server->databases())->unique(fn ($db) => $db::class.':'.$db->id)->values();\n        $services = $server->services()->get()->unique('id')->values();","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ServerTransfer/ServerTransferExporter.php#L61-L97","documentation":"Error \"The Coolify host (localhost) cannot be transferred between instances.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ServerTransfer/ServerTransferExporter.php:79 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"}