Online Copy of an Unlimited Storage Database

Note

This operation is available from version 7.6.8 onward.

The following steps can be used to copy an unlimited storage database whose long-term historical contents are kept on external object storage, such as Amazon S3. This is an online operation, which means that during the copying process, the source database is attached and actively used.

Step 1: Create a milestone in the source database.

This flushes all data prior to that point to external storage. This step is optional but recommended since it will allow you to recover the copy to any time up to the milestone.

Step 2: Copy the bucket containing the database files to a new location. Files for the database will be under <root-path>.

The <root-path> is the path used when the database was created, which should include a bucket and optionally a path within the bucket.

Step 3: Delete the lock file(s) that are located under the <root-path>/<storage-id>/storage_locks/ path.

Remove all files under this path. The <storage-id> is a two-part number of the format <part1>_<part2>, which can be manually obtained from the information_schema.mv_bottomless_status_extended table.

Step 4: Attach the new copy of the bucket at the desired milestone.

Example:

Suppose in the database DB1, a user accidentally deleted all rows from the table F for CUSTOMER_ID 1000, at 1PM.

To recover these rows online, do the following:

1. Execute:

CREATE MILESTONE "copy_point";

2. Copy the bucket for DB1.

3. Delete the lock file(s).

4. Attach the database as name DB2 at a time before 1 PM when the desired data exists.

ATTACH DATABASE DB1 AS DB2 AT TIME '2022-02-10 12_59_00';

5. Execute:

INSERT INTO db1.f SELECT * FROM DB2.f WHERE customer_id = 1000;

Last modified: February 20, 2025

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK