Skip to content
Scalpels home

Sign up now for $10 in credit on a new Laravel Cloud account.

Guide

Move your sites off an old Ubuntu server with Forge

· Ed Grosvenor

Last updated

If you opened Forge expecting to install a security update and found out you need a new server, this is a bigger job than you planned for. You do not have to rebuild every application at once. Start with one site, get its replacement working, and repeat.

Forge's NGINX2Root advisory says Ubuntu 20.04, 18.04, 16.04, and 14.04 cannot receive the fix through its documented package procedure. The nginx.org repository no longer builds packages for those releases. Running the update recipe again will not change that.

The practical route is to create a new Forge server on supported Ubuntu, deploy your applications there, and then move their data and traffic. Leave the old server alone while you prepare the replacement. This guide uses that approach rather than an in-place operating system upgrade.

If your server already runs supported Ubuntu and only needs NGINX and PHP patches, use Patch NGINX and PHP on Forge with an agent instead.

Before you begin

You need access to Forge, your server provider, your source repositories, and whoever controls DNS. DNS is the service that points your domain names at a server. Arrange a maintenance window with the people who use the site. Budget for both servers to exist during the move.

This is a rebuild and data move, not a change of ownership. Forge's Transfer server action moves a server between organizations. It does not replace Ubuntu or copy applications to new hardware.

The examples below assume a Laravel application. Forge also hosts other applications, but their configuration, database export, and maintenance procedures will differ.

If you suspect the old server has already been compromised, stop treating it as a trusted source. Preserve evidence and get incident-response help. Rebuilding from trusted code, reviewing the data, and rotating exposed credentials is different from copying an ordinary working site. A migration alone does not establish that an intrusion is gone.

While you prepare, use the temporary mitigations in the current advisory where appropriate. Disabling HTTP/2 is only partial mitigation, not a fix. Do not let the preparation become a reason to leave the old server exposed indefinitely.

1. Make a list for one site

Record what the site actually uses, not just what you remember installing.

What to record What can get missed
Repository, branch, and deployed commit Uncommitted fixes and files that exist only on the server.
Domain names and redirects www, wildcard subdomains, IPv6 records, and a CDN or load balancer in front.
PHP version and extensions Web requests, command-line scripts, and workers can use different versions.
Environment configuration APP_KEY, database credentials, storage, mail, and external services. Keep values out of the inventory.
Database engine, version, size, and location A database on another server does not necessarily need to move.
Uploaded and generated files Local disks, private downloads, symlink targets, and files outside the repository.
Redis, sessions, and queues Redis may hold pending jobs or sessions, not just disposable cache.
Workers and scheduled jobs Horizon, custom Supervisor processes, system cron, and WebSocket servers.
Server customizations NGINX rules, PHP limits, firewall rules, monitoring, and IP allowlists at other services.

An agent with read-only access can assemble most of this. Forge's dashboard is not a complete inventory of software installed manually over SSH. Check the server too.

Before changing anything, take an application-consistent database backup, a copy of the uploads, and a provider snapshot if available. Store the backups away from the old server. Restore the database backup into a disposable database and open a few restored files. A snapshot is useful insurance, but it does not prove that a live database can be restored correctly.

Forge's database backup feature requires the Business plan. If you do not have it, use your database's export tools or a database client over SSH. You still need a tested restore.

2. Create a supported replacement server

In Forge, open your organization's Servers tab and choose New server. Follow Forge's server creation documentation to choose the provider, server type, region, and size.

Use a supported Ubuntu release. The advisory recommends Ubuntu 22.04 or later, ideally 26.04. Check what Forge and your provider currently offer, and prefer a release with a long support period remaining. For a custom VPS, provision supported Ubuntu at the provider before connecting it to Forge.

If the application and database will share the new machine, choose an App Server. A Web Server does not support installing a database through Forge later. Leave enough disk space for the restored database, uploads, and temporary backup files. If keeping a separate database, confirm that the new server can reach it securely before proceeding.

Install the PHP versions and extensions your inventory identified. Use a patched version that the application supports. Do not assume a very old PHP branch is available on the new OS. If it is not, test the required application upgrade on the replacement before scheduling the move. Do not copy old Ubuntu packages onto it to force compatibility.

Check the replacement's OS and NGINX version over SSH:

cat /etc/os-release
nginx -v
sudo nginx -t

As of November 19, 2026, the advisory lists NGINX 1.30.7 or later on stable, or 1.31.9 or later on mainline, as fixed. Recheck the advisory when you do the move. A newly provisioned server still needs verification. If it needs patching, follow the patching guide before putting it into service. Confirm that the patched binary is running, not just installed. Track kernel updates and any required reboot separately.

3. Recreate the site without touching production

Create a new site on the replacement server. Select the repository and branch during creation. Forge cannot add a repository later to a site created without one. Grant the new server repository access and add any private Composer credentials it needs.

In Advanced settings, select the correct PHP version, web directory, and isolation settings. Turn off push to deploy during the move so a code push cannot unexpectedly redeploy both copies. Review CI deploy hooks separately.

New Forge sites enable zero-downtime deployments by default. Decide whether to use them during site creation. They change the directory layout, and Forge says not to use them with Octane. Keep the new site's generated release commands if you enable them. Port the application-specific parts of the old deploy script rather than pasting the whole script over the new one. Check hard-coded paths and shared storage paths.

Configure the site's environment variables through Forge's environment editor. For Laravel, preserve the existing APP_KEY. Generating a new key can make existing encrypted data unreadable. Review host-specific values instead of blindly copying the whole environment.

For rehearsal, point the replacement at a copy of the database and an isolated copy of writable storage. Stop outgoing mail, payment calls, production webhooks, and other real-world actions using test credentials or application controls. Keep queues and scheduled jobs stopped. Check the deploy script for commands that migrate a database, start workers, or call external services before the first deployment.

Do not let a test deployment run migrations against the live database. Deploy the same application commit first where possible. Changing the OS, application code, PHP branch, and database engine together makes failures harder to untangle.

Recreate the required custom NGINX rules using the new site's configuration as the starting point. Do not overwrite the new server's entire /etc/nginx directory. Old module references, PHP sockets, and certificate paths may not exist there.

4. Restore data and test the replacement

Create the destination database and users through Forge's database panel. Restore your rehearsal backup into that database using a database client or the engine's restore tools. Forge's Restore button restores to the original database. To restore onto another server, its docs say to download the archive and restore it with a database tool.

Check engine compatibility before the final copy. An old MySQL or MariaDB database may need changes before it can restore on the versions available today. Do not copy a running database's data directory between machines or assume MySQL and MariaDB are interchangeable. For a large database or a move that cannot tolerate a write pause, get help planning replication and the final switch.

Copy persistent files over an encrypted connection into the paths the new site actually uses. Preserve the appropriate ownership and permissions for its site user. With zero-downtime deployments, make uploads shared between releases. Copy the persistent storage, not just the currently active release directory. Check private files and any SQLite database too.

Forge gives new sites an HTTPS on-forge.com domain for previewing. Use it for an initial check, but also test your real domain before changing public traffic. Cookies, login callbacks, redirects, and tenant routing can behave differently on a preview domain.

Add the real domains in the new site's Domains tab. Arrange valid certificates before switching traffic. Forge's recommended DNS-01 verification uses a verification CNAME and lets you prove domain ownership without pointing the site's web traffic at the new server. Follow the values Forge supplies, and keep the verification record for renewals. HTTP-01 instead requires the domain to resolve to that server with port 80 accessible. Do not switch live traffic early just to make certificate issuance work.

Forge can also clone a certificate from another site, but cloned certificates do not renew automatically. If you use that route temporarily, arrange a renewing certificate before it expires.

For a direct-origin TLS check, substitute your domain and new server's public IP:

curl --resolve example.com:443:203.0.113.10 \
  --fail --show-error --silent --output /dev/null \
  --write-out '%{http_code}\n' https://example.com/

This connects to the replacement while preserving the real hostname and checking its certificate. Do not add -k to hide a certificate error. For browser testing, use a temporary hosts-file override and remove it afterwards. If your origin is reachable only through a proxy or load balancer, test through an approved route instead of opening the origin to the world.

Check more than the home page. Test login, a representative database read and write on the test copy, uploads and downloads, redirects, and an isolated queue job. Read the application and NGINX logs. Confirm worker PHP versions, filesystem paths, and external-service allowlists.

5. Move live data and traffic

The rule is simple. Only one copy may accept production writes, and only one set of scheduled jobs should run. DNS changes alone do not enforce that. Some visitors will keep reaching the old address until their cached DNS expires.

If changing DNS, lower the relevant records' TTL ahead of the maintenance window. TTL is how long resolvers may cache the old address. Allow the previous TTL to expire before relying on the shorter one. Record the old values, including IPv6 AAAA records. If a CDN or load balancer controls routing, record and change its origin or backend settings instead.

Use this order during the agreed window:

  1. Pause incoming writes on the old site. Use application maintenance mode or your established traffic controls. Include APIs, uploads, incoming webhooks, and integrations. Confirm important webhook senders will retry, or arrange a way to retain their deliveries.
  2. Stop other writers. Pause the old site's scheduler, external cron triggers, and background processes. Let in-flight jobs finish within an agreed limit, then stop the site's workers or Horizon under their process manager. Laravel's queue:restart is not a permanent stop because Supervisor starts workers again. Maintenance mode alone is not a complete write freeze.
  3. Take the final copy. With writes stopped, export and restore the live database and copy the final changed files. Verify the restore and file transfer succeeded. Keep pending, delayed, and retry jobs if moving their queue backend. If jobs live in local Redis, a database dump will not include them. Do not flush Redis as if it were all disposable cache.
  4. Set production configuration on the replacement. Point it at the authoritative database, queue, and storage. Rebuild Laravel's configuration cache and restart long-running processes as appropriate. Check session storage too. Local sessions may need moving, or users may need to sign in again. If keeping an external production database, skip its copy and give only the new app permission to resume writes when ready.
  5. Switch routing. Update the relevant DNS records, proxy origin, or load-balancer backend. Keep the old site in maintenance mode or deliberately forward its traffic to the new origin. Do not reopen the old writable copy for visitors with cached DNS.
  6. Resume service on the replacement only. Enable its workers, Horizon, and scheduled tasks once. Restore production integrations and monitor deliveries. Verify a real request, upload, and job through the public domain from outside the server. Check errors, queue depth, and both servers' access logs.

Recreate queue workers with the correct connection, queue names, PHP version, and retry settings. For Horizon, use its Forge integration and background process rather than creating an additional set of ordinary workers. Recreate the scheduler with the right user, path, frequency, and timezone. Creating a Forge scheduled job activates it, so wait until the old copy is stopped.

Forge's zero-downtime deployment feature protects code releases. It does not make a server and database migration zero downtime. A short, planned write pause is safer than pretending two independent databases will stay in sync.

6. Know what going back would mean

Before the replacement accepts writes, you can usually abandon the attempt and resume the old application against its original data. That restores availability, but the old NGINX is still vulnerable. Restrict exposure and fix the replacement rather than treating this as a long-term fallback.

After the replacement accepts writes, do not just point DNS back at the old database. New orders, uploads, and other changes would be missing. Pause writes again and reconcile the new data, or restore service on the replacement. If both app servers use the same external database, check code and schema compatibility before routing back, and keep only one scheduler active.

Write down the rollback decision before the move, including who can make it. If you cannot explain where the latest data will be after going back, you do not yet have a rollback plan.

7. Retire the old server deliberately

Keep the old server out of public service while you observe the replacement. Restrict access using controls that preserve any still-needed dependencies and Forge administration. A vulnerable, publicly reachable server is not a safe backup. Do not leave the old scheduler or workers running.

Before deleting it, check every remaining site and dependency. Another application may still use its database, Redis, files, or scheduled jobs. Verify fresh backups on the replacement, alerts, certificate renewal, deploy hooks, and external IP allowlists. Keep a tested off-server backup under your normal retention policy.

Forge's server deletion documentation warns that deletion normally destroys the provider's server and its data. Read the confirmation carefully and get the owner's explicit approval. Archiving only removes Forge's access, leaves the machine running, and continues provider charges. It is not a security fix or a substitute for retirement.

Let an agent do the inventory and rehearsal

An agent can compare configurations, find hard-coded paths, prepare transfer commands, and check the replacement. You should not have to translate every log line yourself. The useful boundary is between preparing the move and making production changes.

Give it scoped, short-lived access through your tool's secret store or masked credential input. Do not paste API tokens, SSH private keys, environment files, or database dumps into chat. An API integration does not automatically give the agent SSH, provider, or DNS access. Start with read-only access and add only the permissions needed for an approved step. Revoke temporary access afterwards.

You can start with this prompt:

Help me move one application from an old Ubuntu Forge server to a
new server on supported Ubuntu. Start read-only. Use the current
Forge docs and NGINX advisory, and inspect the repository and server
configuration through the access I provide securely.

Inventory the runtime, domains, deployment, persistent files,
database, sessions, queues, scheduled jobs, and external services.
Report missing access and unknowns without guessing. Keep secret
values and customer data out of chat and logs.

Propose a replacement and rehearsal plan, its cost, a tested backup
and restore, a write-freeze procedure, and a rollback plan that
preserves changes made after the switch. Identify steps you cannot
perform with the available tools.

Ask for approval before creating paid resources or changing any
production system. Get separate approval for the final data copy
and traffic switch, and again before deleting anything. Keep the
replacement isolated from production data and external side effects
during rehearsal. Verify the public site and background work after
the approved switch. Do not call it complete while writes or jobs
can still run on both copies.

The documentation links in this guide were checked on November 19, 2026. The migration sequence is operational guidance, not a claim that Forge copies an entire server for you. If a restore fails, a required runtime is unavailable, or the downtime budget does not fit a final data copy, ask for help before changing production traffic.

Changelog

  1. Published.

Need a hand moving your sites to a supported server?

These agencies and freelancers are standing by and ready to help.

  • Scott Keck-Warren

    Michigan

    PHP and Laravel developer with 13 years of experience building and maintaining production apps. US Eastern, English.

    Freelancer Ask for help
    Ask Scott Keck-Warren for help
  • Artisan Build

    USA

    We run Scalpels, as well as a suite of other tools for developers and development teams.

    Agency Ask for help
    Ask Artisan Build for help