Move from Railway to Naijacloud
Your Railway service running on Naijacloud as a web service, with its variables, its Postgres data and its domain, and the Railway project kept as a rollback.
What things are called here
Before you move: what Railway has that we don't
- Billing by actual CPU and memory use. An idle service costs the same here as a busy one of its size.
- Volumes attached to a service.
- Reference variables that resolve another service’s values.
- The template gallery.
- A SOC 2 report.
- Regions outside Africa and Europe.
If your app depends on one of these, stay on Railway for now.
The cutover, in order
The order is what keeps the site up. Each step below matches one point on this line.
- 01Lower DNS TTL48 hours before. Set the record to 60 seconds.
- 02Deploy here and add the domainTraffic still goes to Railway.
- 03Certificate issuedWait for it before you touch DNS, where you can.
- 04Copy the dataDump, restore, compare the counts.
- 05Switch DNSPoint the record at Naijacloud.
- 06Keep the old project 7 daysGoing back is one DNS change.
Lower the DNS TTL, 48 hours before
At your DNS provider, set the TTL on the record that points your domain at Railway to 60 seconds, then wait at least as long as the old TTL.
Deploy here and add the domain
In the dashboard, create a Database (Postgres) and copy its Internal URL. Then create a Web service from the same repository and branch, or from the same Docker image if Railway deploys one. Copy Railway’s custom build and start commands across if you set any.
Export the service’s variables from Railway and load them here:
Reference variables come out of railway variables already resolved, pointing at Railway’s hosts. Delete DATABASE_URL, any REDIS_URL and every RAILWAY_ variable from the file before importing, then set DATABASE_URL to the new database’s Internal URL under Variables and run naijacloud redeploy my-app. Test the app on its naijacloud.app address.
Then open Domains, enter your domain in Custom domain and click Add domain. Add the records it lists that prove ownership and issue the certificate. Don’t change the routing record yet.
Wait for the certificate
Where the Domains table lists ownership and HTTPS records, the certificate is issued while traffic is still on Railway. Wait until the domain shows Verified · HTTPS ready.
If the table lists only one routing record (an A record, as it does for a root domain and in some regions), the certificate is issued in the minutes after the record points here. Plan the switch for a quiet hour.
Copy the data
Use PostgreSQL 18 client tools. Railway’s Postgres service has a DATABASE_PUBLIC_URL variable for connections from outside Railway; use that one. On Naijacloud, add your IP under the database’s External access → Specific IPs, switch Connection to External · TLS and copy the Connection URL.
How to know the restore is complete. Run analyze; on both databases first — n_live_tup is only an estimate until you do. Then compare the table list, exact counts on your two or three largest tables, the sequence values, and the extension list. Matching row counts with a sequence still sitting at 1 means the next insert will collide.
If a Railway service writes files to a volume, move them to a bucket in Object storage and change the code to write there; there is no disk to copy them to. Add file uploads with object storage shows the client setup.
Switch DNS
At your DNS provider, replace Railway’s record with the routing record shown in Domains. With a 60-second TTL, most visitors follow within minutes. Leave the custom domain on the Railway service.
Keep the old project for 7 days
Leave the Railway service and its Postgres running. Its up.railway.app address keeps working, which makes it easy to check the old version still answers if you need it.
- The Railway service, still deployed
- The Railway Postgres service and its volume
- The app.dump file
- The 60-second TTL on your record
To go back: point the record at Railway again. Its up.railway.app address shows the old version is still running.