Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Salesforce Administrator
hard

How would you migrate a complex managed package to a new namespace, and what are the risks?

Background: a managed package's namespace prefixes every API name (acme__Object__c). Once a package is in production, changing the namespace is essentially impossible without rebuilding it as a new package and migrating data — Salesforce does not support direct namespace migration.

So when this comes up, it's typically because:

  • The package was built unmanaged or with a temp namespace and now needs to go ISV-managed.
  • A namespace was deprecated or transferred between Dev Hubs.
  • Multi-org consolidation requires unifying packages.

The "migration" is really a parallel rebuild + data migration:

  1. Build the new package in a fresh Dev Hub with the target namespace. Replicate all metadata. This is mostly automated via Salesforce DX (sf project retrieve from old, sf project deploy to new).
  2. Install the new package in target orgs alongside the old one. Both run in parallel during transition.
  3. Migrate data. Custom object data must be copied row-by-row from oldns__Object__c to newns__Object__c. Use Data Loader with field mapping, or a script via Apex Batch / external ETL.
  4. Migrate references. All Lookup fields, formula fields, and Apex code referencing oldns__ need to be updated to newns__. This is where most of the work is.
  5. Test in sandbox extensively. Side-by-side comparison of old vs new during a quiet period.
  6. Cut over — disable old package's UI/automations, enable new, validate, then uninstall old (which deletes the old data — back it up first).

Risks:

  • Lookup field re-pointing — every record's lookup needs the new id. Doing this at scale without breaking sharing or breaking referential integrity requires careful sequencing.
  • History gap — Field History on the old object doesn't migrate. You either accept the gap or export-and-store-elsewhere.
  • Integrations — every external system referencing oldns__Object__c needs to be updated to newns__Object__c. This is the largest blast radius.
  • Reports and dashboards — referencing the old API names break. Rebuild against the new package's report types.
  • Custom code referencing oldns__ — must be rewritten and redeployed.
  • Validation rules and flows — same.

The honest answer: namespace migration is one of the biggest projects an admin/architect can take on. The decision is usually "do not start" unless absolutely necessary. The right answer in an interview is to surface those risks first, then describe the rebuild strategy.

Why this answer works

Senior architect-level question. Tests scope-recognition first — the right answer says "this is a major project, here's why, here's the only safe approach". Naming the parallel-install + data-migration pattern is the strongest signal.

Follow-ups to expect

Related dictionary terms