Docs /Mason

Export & import

A brick library is real work, and until now it lived in exactly one database. Export writes your bricks and stacks to a JSON file; import reads one back. Use it to move a brick to another site, hand one to a colleague, keep a library in version control, or seed a new build from an existing one.

Exporting

Three ways, depending on how much you want:

  • A selection — tick bricks on the Bricks list and choose Export from the with selected menu.
  • A stack — open a stack from the sidebar and use Export; you get just that stack's bricks.
  • Everything — Transfer → Export all bricks in the sidebar.

You get a .json file. It is plain text and diffs sensibly, so it is safe to commit alongside the templates that use the bricks.

Binders come along automatically. If a brick you export binds a binder, that binder is included even if you did not select it — without it the brick would import cleanly and silently lose those fields.

Importing

Transfer → Import bricks, choose a file, and you get a review screen before anything is written. It lists every brick in the bundle as either new or a conflict with something you already have, names any stacks that will be created, and warns about references it cannot resolve.

For each conflict you choose:

Choice What happens
Skip Your existing brick is left completely alone. The default.
Overwrite Your brick is replaced by the one in the bundle.
Import as copy The bundle's brick arrives as handle_copy, leaving yours untouched.

Nothing is written until you confirm, and skip is always the default — overwriting is something you choose, never something that happens because you did not look.

What moves between sites, and what cannot

Most of a brick refers to things by name, so it travels: channels, filter fields, and binder references all survive a move as long as the target site has something of the same name.

Two settings are different. An upload directory and a relationship's channels are stored as numeric ids, and an id means something else entirely on another site. Mason converts them to names on export and looks them up again on import.

If a name does not exist on the target site — you export a brick using an upload directory called "general" and the other site has no such directory — the setting is left empty and the import report tells you so. The brick still imports and still works; you simply choose a directory for it. That is deliberate: the alternative is a brick quietly saving uploads somewhere nobody intended.

Stacks are matched by name too. A stack in the bundle that does not exist is created; one that already exists is reused rather than duplicated.