Docs menu

Docs

Known limits

Applies to prodmask Pro 1.0.0-beta.2

What prodmask Pro does today, and doesn't. It's tested on MySQL 8.4 and MariaDB 11.8, with WordPress and WooCommerce, Magento 2 and Laravel; any other MySQL or MariaDB schema gets the generic rules.

What the copy's check doesn't look for. The check after every copy looks for this run's customers' emails, phone numbers, IBANs, card numbers, national IDs, full names and street lines, and for live secrets. It doesn't look for first or last names on their own, cities, postcodes, companies, dates, IP addresses, usernames, user agents, phones and IDs stored as numbers, names split across fields, or compressed or encoded values.

Exempting the shop's own text from the check. Where a name, a street line, a phone or an ID the check finds is the shop's own text, not a customer's, such as a product named like a customer, prodmask.yml's verify: section exempts its column, or a key of a key/value table, from those kinds:

verify:
  exempt:
    - { column: wp_posts.post_title, kinds: [names] }
    - { key: "wp_options[blogdescription]", kinds: [names, streets] }
  • Exact names only, of a column or a key, never a pattern. So a WordPress network needs an entry for each site's table.
  • The kinds are names, streets, phones and ids. Emails, IBANs, card numbers and secrets can't be exempted.
  • Reviewed. A change to the section needs a new plan, whose review lists each exemption under "Could leak", by its line. The copy's summary names each exemption that absorbed a match, as in "prodmask.yml line 31, the exemption of names in wp_posts.post_title, absorbed 2 matches."
  • For the check only. The copy still replaces the customer details it finds in an exempt column or key. So an exemption only matters where the check reads what that replacement didn't: text that isn't valid UTF-8, a value a keep_if_* rule kept for its shape, and the target's generated columns.

What a copy can keep:

  • the schema's own text: column defaults, comments, CHECK constraints and view definitions are copied as the source has them;
  • values that aren't valid UTF-8 text, which the copy keeps and warns of by column until prodmask.yml gives the column a rule;
  • in serialized or JSON values that don't open, a password that only its key's name gives away;
  • on a WordPress network, a renamed sub-site's old name where it's a plain word in text, as in "maria's blog", rather than part of an address;
  • emails, phone numbers and card numbers written other than as plain text: with HTML entities such as @ for the @, with non-breaking spaces ( ) between a number's groups, as the WordPress editor writes them, or percent-encoded. The copy's check doesn't find them either;
  • a password or token inside longer text when it isn't in a format prodmask knows: in a link such as ...?token=... or ...?password=..., or a webhook address whose path is the secret. Give the column or key a rule in prodmask.yml to clear it.

What a copy leaves out: triggers, events and stored routines; views that call a stored routine; and views that read another database, unless prodmask.yml keeps them (views: keep_cross_schema), which works only where that database is on staging as a masked prodmask copy. Each is named in a warning.

What can differ on staging:

  • on a WordPress network, every sub-site but the main one is renamed site<N>, with the title Site <N>;
  • Magento's two-factor sign-in needs an enrolment email, which a copy with mail off doesn't send: on staging, send mail to a catcher, or turn the module off;
  • Laravel is a first pass: Horizon, Nova and Cashier aren't covered yet.

WordPress networks. The copy renames a network's sites, as above. It refuses a network it can't rename, with exit status 3, before it writes anything. The table names here are examples:

  • "prodmask.lock's network: names other tables than the source's multisite network; run prodmask plan, a full plan, which writes it again": the lock was edited by hand, or the database's main WordPress install changed since the plan. Run a full prodmask plan.
  • "prodmask.lock has a network: line, but the source has no WordPress multisite network under its main prefix; run prodmask plan, a full plan, which drops the line": the database isn't a network any more, or its main WordPress install moved to another table prefix. A full plan drops the line.
  • "the copy leaves out wp_blogs (…), so the network's sites can't be renamed": the copy can't copy one of the network's own tables, such as a MERGE table over another schema, so it can't tell which sites to rename. A plan can't change that: make the table an ordinary one.
  • "wp_site is a view, which the copy reads no rows of, so the network's sites can't be renamed; the network needs it as a table": one of the network's tables is a view in the source, and the copy can't rename the network's sites from a view. Make it a table.
  • "the copy doesn't copy wp_blogs, so the network's sites can't be renamed; run prodmask plan": the lock doesn't copy one of the network's tables. Run prodmask plan.
  • "prodmask.yml line 12 empties wp_blogs, so the copy's network would have no sites; remove the line", or with more lines, "prodmask.yml lines 7 and 8 empty wp_site, so the copy's network would have no sites; remove the lines": a line of prodmask.yml makes wp_blogs or wp_site transient, with classes: or a tables: entry's class:, or truncates it, with action: truncate. Staging's network would have no sites to serve. Remove the line.
  • "the copy writes wp_site empty, so its network would have no sites; the copy can't write its rows": the same, for a network table the copy can't write rows into, such as a BLACKHOLE or MERGE table. Make it an ordinary table.
  • "the copy can't read wp_blogs.path, so the network's sites can't be renamed": a column WordPress writes in wp_blogs or wp_site is missing or generated. Restore the column.

The copy warns, and goes on, where it can copy a network but can't rename all of it:

  • "wp_site and wp_blogs have no rows, so the copy treats the source as a single site": the database was once a network, and its network tables are empty. A site left from it has its title replaced, with a warning, as below.
  • "the tables under wp2_ are a second multisite network, which prodmask doesn't rename; every sub-site there keeps its addresses and titles": the database holds a second WordPress install, and that one is a network. Only the main install's network is renamed. Copy the other from its own database, or check its sites before you share the copy.
  • A site left behind has tables but no row in wp_blogs, as when a site is deleted and its tables are kept. Its warnings name the network's own tables, such as shop_blogs for a network under shop_.
    • It's renamed site<N> from its own address, like any sub-site, with no warning.
    • Where it has no address of its own, because its home and siteurl are other sites' or missing, its title is replaced, and the copy warns, naming its options table. The main site's address counts as another site's, even where the main site has no row in wp_blogs. So do the root and any parent path of it, such as the host's root for a network under /blog, since a rename there would move the main site's addresses. The warning reads "wp_5_options has no row in wp_blogs and no address of its own: its home and siteurl are other sites' addresses, parent paths of them, or missing, so its title is replaced". Where the site has an address of its own but the copy couldn't rename it, as where the network couldn't be read, it reads "wp_5_options has no row in wp_blogs, and the copy couldn't rename it, so its title is replaced and its addresses stay production's".
  • A site new since the plan: "wp_7_options has no row in wp_blogs and is new since the plan, so its tables are copied as new tables". Run prodmask plan to have it planned.
  • A separate single-site WordPress beside a network, under its own table prefix, counts as a site left behind. It's renamed, or its title is replaced, unless an entry of rewrite_urls names its exact address.
  • "wp_options is a site of a network the copy couldn't build, with no row in wp_site and no siteurl it could use, so its title is replaced and its addresses stay production's": the network's wp_site row is gone, and wp_sitemeta has no siteurl the copy can use.
    • The network's sites keep their addresses.
    • Every title is replaced, the main site's too, unless an entry of rewrite_urls names its address. A second site with that same address has its title replaced too.
    • A site of such a network that's new since the plan gets "wp_7_options is a site of a network the copy couldn't build and is new since the plan, so its tables are copied as new tables".
    • Restore the wp_site row to have them renamed.

When network tables are empty:

  • With no row in wp_site, the copy builds the network from wp_sitemeta's siteurl, which picks the main site, so its sub-sites are still renamed.
  • With no row in either network table, the database isn't a network, and the copy copies it as a single site.

Dates and times under fake_date. fake_date moves a date by up to a year, earlier or later. Where the value also has a time of day that isn't midnight, the time is drawn too: a new hour and minute, and new seconds and fraction where the original's aren't zero. So a time on the hour gets one at any minute, a time to the minute stays to the minute, and a time to the second stays to the second. A date with no time, or at midnight, keeps its time, so a date of birth stays a date.

Each value moves by its own amount. So two times in one row, such as an order's created_at and updated_at, can come out in either order in the copy, and a schedule of whole or half hours doesn't stay one. In customer rows, the same moment gets the same fake in every table, however each column writes it; in published content, fakes are linked to nothing else.

A DATE and a DATETIME that record one event don't share a day in the copy: the time of day is part of what the fake is drawn from. Near the ends of a TIMESTAMP column's range, within a year of 1970 or 2038, one moment in a TIMESTAMP and in a DATETIME can get two different fakes.

A date written with slashes that reads either way, such as 05/06/1990, gets a new day and month, each up to 12, and moves 1 to 3 years, so it still reads as a date either way. Its two fields are written alike, as the original's style was: both with two digits where either had a leading zero or both had two digits, and neither otherwise.

A date column in any unique index, alone or with other columns, can't take fake_date: prodmask plan blocks it, since a date has too few fakes to keep a unique column unique.

IBANs under fake_iban. A value that holds an IBAN gets a fake IBAN of the same country, length and layout.

A value that holds no IBAN gets a fresh IBAN where the value has a letter, in any alphabet, and at least 5 bytes other than spaces, such as a note or an account holder's name, and the column is wide enough for an IBAN, 15 characters or more. Bytes, not characters: a letter outside the basic Latin alphabet takes two bytes or more, so a four-letter name in Cyrillic or Greek gets an IBAN where the same name in Latin letters gets digits. The fresh IBAN passes the IBAN checksum and its country's length; its account part is all digits, which a check of a country's own account format may refuse.

Any other value that holds no IBAN, such as a sort code, a routing number or n/a, and any value in a narrower column, gets digits instead: one for each byte but spaces, as many as the column holds. A blank value stays as it is. Nothing of the original value is kept but that count. So a placeholder such as unknown becomes one IBAN that every row holding it shares, and n/a becomes three digits, where an empty value would have read as no bank details.

An older starter config. A starter config written by a scan before v0.14.1 can hold a fake_* line on a unique column of 3 characters or fewer. prodmask plan stops at that line, and its words name hash, which can't help in so few characters. Delete the line, so prodmask chooses, or keep the column with keep:.

A suspended copy of a replica. A replica copied without --max-snapshot-age has no age limit. So a copy suspended there keeps its locks, which holds back the DDL the replica applies. Give --max-snapshot-age where that matters.

prune on a multi-primary group. On a member of a multi-primary group replication group, prune can't see a lock a run took through another member, so it keeps every run's leftovers unless you give --force. It says so for each, as "(run <id> may be going through another member of the group, whose locks this one can't see; --force removes it)". In a single-primary group, prune on the primary works as anywhere else, and its secondaries are read-only, which prune refuses.

A limit past 30 minutes. With --max-snapshot-age above 30 minutes, a copy stopped while rows waited to be taken loses its session after 30 minutes. It says the server ended the session only if it stayed stopped for longer than the limit; otherwise it says it lost the connection, or gives the age limit's words. The default, 15 minutes, isn't affected.

A laptop that sleeps behind a NAT router loses the watchdog's own connection too. So that copy can end with "stopped the copy: the lock watchdog couldn't watch (…)" rather than the server's words. The server still ended its session and released production's locks; only the message differs. Run the copy again.

What the server reports. The copy reads its time limits back from the source's server. That checks what the server reports, not what it does: a proxy that reports a setting it doesn't apply defeats the limit, and the copy can't tell.

A source named nextval or setval. A source table, view or sequence named nextval or setval stops plan and copy with the checker's refusal, before the copy writes anything: MariaDB can read such a name, after its database's, as a sequence call. Tell us at support@prodmask.com.

Size. --memory, 1 GB by default, bounds what the masking and the check hold in memory. A copy that needs more fails, says what needs it, and removes what it staged; staging stays as it was. A table with no primary key is copied whole.