server = $serverToTransfer; $this->node = $newNode; $this->allocation_id = $allocation_id; $this->additional_allocations = $additional_allocations; } /** * Execute the job. * * @param ServerCreationService $creationService * @param ServerDeletionService $deletionService * @param SuspensionService $suspensionService * @param TransferService $transferService * @return void * * @throws \Pterodactyl\Exceptions\DisplayException * @throws \Throwable */ public function handle( ServerCreationService $creationService, ServerDeletionService $deletionService, SuspensionService $suspensionService, TransferService $transferService ) { //$server = $this->server; //$newNode = $this->node; // 1. Suspend Old Server //$suspensionService->toggle($server, 'suspend'); // 2. Zip Folder //$backup = $server->generateBackup(); // 3. Transfer Zip File //$archive = $newNode->transfer($backup); // 4. Verify File Hash /*if ($backup->hash !== $archive->hash) { $archive->delete(); abort(500, 'File transfer corrupted, please try again.'); }*/ // 5. Unzip File //$archive->extract(); // 6. Update Settings on New Node //$newServerDetails = $server->toArray(); //$newServerDetails['node_id'] = $newNode->id; //$newServer = $creationService->create($newServerDetails); // 7. Verify Server Status /*if (!$newServer->isWorking()) { $deletionService->withForce()->handle($newServer); abort(500, 'Server failed to startup, please try again.'); }*/ // 8. Unsuspend Old Server //$deletionService->withForce()->handle($server); //$suspensionService->toggle($server, 'unsuspend'); } }