Blog
·7 min read

Migrating Archived and Soft Deleted Bubble Records

Consider a project a customer archived months ago. After a rebuild, it appears in their active workspace again. Its records survived the move, but the decision to put that project away did not.

The opposite failure is possible too: an importer skips archived projects, leaving historical work without its parent or removing the customer's ability to restore it.

When migrating archived and soft-deleted Bubble records, preserve their lifecycle as well as their contents. Agree which records remain available, where they appear, what actions they allow, and how restoration works. Then test those decisions through the final sync, including changes made after the first export.

Start by finding out what delete actually does

A button label does not explain the underlying operation. Bubble documents separate actions for changing a thing and deleting a thing. Your application's workflow determines which action runs and what else happens around it.

For the migration, distinguish three behaviors:

Archive: Keep the record for an agreed purpose, usually outside everyday work. It may remain readable or restorable.

Soft delete: Keep the underlying record while treating it as removed from normal use, often through a flag, status, or timestamp.

Hard delete: Remove the record from the application database. Recovery, if available, follows a separate process.

These are working definitions, not built-in lifecycle guarantees shared by every Bubble app. Some products use “archive” for a completed item; others use it as a trash folder. Inspect the implementation before mapping either word to a new database field.

List the entry points: customer buttons, admin bulk actions, backend workflows, APIs, and maintenance scripts. For each, record what changes, who can trigger it, and whether related records or external systems are affected. Keep record removal, file removal, and account closure as separate decisions unless the product explicitly connects them.

Write a behavior contract for each record type

An archived project and an archived product listing may need different treatment. The project might remain visible to its team, while the listing should disappear from public browsing but remain referenced by previous orders.

Write the intended behavior in plain language. For example:

“Archived projects leave the active workspace. Existing members can read them in the archive. They cannot add tasks. A workspace administrator can restore them if there is no naming conflict. Historical invoices remain available through their existing permissions.”

That is an illustrative contract, not a universal recommendation. It gives the migration team concrete outcomes to build and demonstrate.

Include what happens when fields disagree. A record might have an archive flag set while its status still says active. An older record might have no lifecycle value at all. Decide which evidence takes precedence and put unresolved cases in an exception list. Do not silently make every blank value active.

Preserve genuine source timestamps where available. If the source never recorded the archive time, keep that uncertainty rather than substituting the import date and presenting it as customer history.

Carry the state into every read and write path

Filtering the main list is only one part of the implementation. An archived record can still appear through a direct URL, a relationship picker, an API response, a cached search result, or a downloaded report.

Identify each consumer and decide whether it should include the record. A historical report may intentionally include archived work while a “choose an active project” dropdown excludes it. Avoid applying one global filter without checking those differences.

Enforce write restrictions on the backend. Test someone who opens an edit form, leaves it open, and submits after another person archives the record. The server should apply the current lifecycle rule and return a useful result. A disabled button in a newly loaded page does not handle that stale form.

Lifecycle state and authorization also answer different questions. Restoring a project must not grant access to a former member or another customer. Apply both checks to reads, updates, and restoration.

For copied search indexes and caches, define how archive changes reach them and what delay is acceptable. If a stale result can remain briefly visible, opening it must still follow the current access and lifecycle rules.

Moving data into a relational database does not settle the meaning of an archive action.

PostgreSQL foreign-key rules can restrict a parent deletion, delete related rows, or change their references. Those mechanisms concern database relationships. Updating an archive flag does not, by itself, invoke an “on delete” action.

For each parent-child relationship, decide:

Do children remain independently usable, become read-only, or become hidden with the parent?

Can a child be restored while the parent remains archived?

Does restoring the parent restore every child, or only those archived with that operation?

What happens to children that were already deleted before the parent was archived?

That last distinction matters. Restoring a project should not automatically revive a task the customer had separately removed earlier. Preserve enough state or event information to distinguish those situations if the product requires it.

Treat attachments explicitly too. Restoring a database row cannot recreate file bytes that have been removed. The Bubble file-upload migration guide covers attachment ownership and deletion separately; connect its decisions to this lifecycle contract.

Test restoration when the world has changed

A restore button needs more than a switch from deleted to active.

Suppose a workspace allows project names to be reused after deletion. A customer deletes “Website refresh,” creates a new project with that name, and later restores the old one. Decide whether restoration requires a rename, is blocked with an explanation, or follows another approved rule. Never merge records merely because their names match.

PostgreSQL supports partial unique indexes, which can enforce uniqueness across a selected subset of rows. An engineer could use one for names that must be unique among active projects within a workspace. That design still needs an explicit restoration-conflict policy and tests for simultaneous operations.

Check other changed conditions: the original owner may have left, the workspace may be closed, or the archived record may reference an option that is no longer supported. Define the decision and error message before launch. Do not restore old permissions simply because they were stored beside the old record.

Prevent the final sync from undoing deletions

Take a record copied during the first export and deleted in Bubble before launch. Replaying the original export can recreate it unless the import process accounts for that later deletion.

Record lifecycle changes alongside ordinary edits. Soft-deleted rows may still be available to extract, but verify that the chosen export includes them and their state fields. Hard-deleted rows require another reliable source of deletion evidence, such as an explicitly maintained deletion record or a complete, reconciled comparison during a controlled write pause.

Do not infer deletion from an incomplete API response or a search whose permissions hide records. Establish that the source population and extraction are complete before interpreting absence. The broader Bubble data migration checklist explains scope and source-ID reconciliation.

Specify which system owns lifecycle changes at each stage. Repeated imports must not overwrite a newer archive, deletion, or restoration with an older state. Keep a durable source-ID mapping and a tested rule for ordering changes.

Pending work needs the same attention. A reminder created before a project was archived should not run simply because its queue entry migrated successfully. Check the current record state before the consequential action, and define how cancellation races are handled. Coordinate this with the scheduled-workflow migration plan.

Use these cases as a launch gate

Build a small representative dataset and record the expected outcome for each case:

An archived record stays out of active lists but remains available through its approved archive view.

A direct link and a stale edit form respect the current state and permissions.

A separately deleted child stays deleted when its parent is restored.

A restore conflict produces the agreed result without overwriting another record.

Two simultaneous restore or create requests cannot violate the chosen uniqueness rule.

A deletion after the first export survives the final sync and a repeated import.

A queued action encounters an archived or deleted target and follows the agreed cancellation rule.

Historical reports and attachments retain their intended behavior without reopening unrelated access.

Reconcile source IDs by customer and lifecycle state, not only a total row count. Document approved exclusions and resolve unexplained differences before switching traffic. Keep the same tests available after launch.

Sources

  1. 01changing a thing and deleting a thing · Bubble Docs
  2. 02PostgreSQL foreign-key rules · PostgreSQL Docs
  3. 03partial unique indexes · PostgreSQL Docs
  4. 04a search whose permissions hide records · Bubble Docs

Keep reading

Bubble to Code is an independent service. Not affiliated with, endorsed by, or sponsored by Bubble Group, Inc.