Customers in Production
Once a project has a ready Production, the Customers page has an Environment switch: Development and Production. Production’s customers are tenants of Production’s data service, separate from Development’s. A project without a ready Production shows Development’s customers only, with no switch.
How Production’s customers differ
- Separate customers. Production’s customers are not copies of Development’s. Create each one in the Production environment: a name, a slug and the address of its first administrator, as in Development. Use the same slug as its Development counterpart, so it keeps its address when a domain moves to Production.
- Their own quota. The quota counts each environment apart.
- After the first Promotion. A Production customer can be created once a release is live in Production. Until then the page says so.
- Copied from Production. A new Production customer starts from Production’s live structure.
- Locked structure. Like Production itself, a Production customer’s structure is locked. Its records, files and people stay writable. Only Releases change its structure.
- No sign-up. Self-onboarding is offered in Development only.
The page lists the Development customers that have no Production customer of the same slug, so you can see who is still missing.
Releases in Production
Production’s Releases come from Promotions, not from Publish. When the project’s data service supports Releases, each Promotion of a release that goes live publishes Production’s structure as a Release of its own, with a note such as “Release 2 went live in Production”. Production numbers its Releases on its own, so that one may be Production’s Release 1. A dry run of it to every ready Production customer starts at the same time.
Open Customers, switch to Production, read the dry run under Releases, then roll it out as in Development: Roll out a Release, the same Release and customers, then Roll out. A Rollout without a Release named takes the newest.
A customer created before Production’s first Release has no Release on record, so its first dry run may list each object the Release changes as drift and skip it (skipped drift). If nobody changed that customer’s structure, which is the case for a new customer, tick Overwrite drift, run the dry run again, and roll out with it still ticked. See A customer’s first Release.
To bring a Production customer up to date, roll a Release out to it. Deleting it and creating it again does not work quickly: a customer being deleted keeps its slug until the deletion completes.
The host map
Your app finds a customer from the address it is opened at, <slug>.<domain>. It reads which
tenant each slug is from the host map, the server variable BUILDPAD_CUSTOMER_HOSTS on its
Amplify branch:
- Development’s customers on the
mainbranch; - Production’s customers on the
productionbranch.
The map holds slugs and tenant ids only. After you create, delete, suspend or resume a customer, the Customer host map card says Out of date. Click Update and redeploy to write the map and build the app again; the new customer is reachable once the build finishes. In Production, the build is of the live release. Your app’s code reads the variable; do not commit a map.
XAppHub sign-in
One confirmation and one XAppHub connector serve both environments. While XAppHub sign-in is confirmed for the project (see XAppHub sign-in), every ready Production customer trusts the XAppHub client too, and each has its own switch, retry and starting role. The Connectors page lists the redirect URLs to add in XAppHub: Production’s default address, and each Production customer’s address on a domain that serves Production. Disconnecting removes the trust from Production’s customers too.
Moving a domain to Production
When a custom domain with Sub-names moves to Production, every customer address under it moves with it. The Platform refuses the move while a ready Development customer has no ready Production customer of the same slug, and names them. Create them in Production first, or type their slugs to move the domain anyway: those customers cannot be reached until they exist in Production. See Custom domains.
Before the move, check that each Production customer has the live Release (its Release column), and remember that it holds Production’s data, not Development’s: people who open its address after the move reach Production’s customer.
Keeping an address for Development
After the move, Development’s apps use https://main.<app id>.amplifyapp.com, and Development’s
customers have no address of their own. To keep one:
- Before moving, add a second domain to the app on its Builds page with Sub-names on, for
example
lms-devforlms-dev.apps.buildpad.ai. It serves Development. - Make sure your app treats addresses under both domains as customer addresses, and press Update and redeploy on the host map in Development.
- Move the first domain to Production.
- Set
NEXT_PUBLIC_HOST_ORIGINon Development’smainbranch to the second domain’s address, and any other setting that holds the app’s own address, then redeploy Development. - On Connectors, add the redirect URLs it lists for the new addresses in XAppHub.
Backups, restores and removal
- Production’s backups hold every Production customer. Restoring one rolls them all back to that moment, and the confirmation names them.
- Going back to an earlier release rebuilds the apps; Production customers’ data is not changed.
- Removing Production removes its customers with it. The confirmation lists them and asks you to type how many there are.