Documentation

esc
    Move to Pantech / Move buckets

    Move buckets into Pantech object storage

    Copy an S3 bucket's objects into Pantech object storage without sharing a key, with an opt-in role that can read only the buckets you choose, then resync until you switch over.

    A bucket import copies one S3 bucket's objects into a Pantech bucket. Pantech reads the source with a second, opt-in role in your AWS account that can read only the buckets you choose, and writes into your own Pantech bucket. Nothing is deleted on either side unless you ask, and the source keeps serving until you switch.

    You need:

    • an AWS connection that is connected;
    • Pantech object storage turned on for your organization. It is available on request: until it is on, a plan flags each bucket object_storage_not_available and starting an import answers 403 OBJECT_STORAGE_NOT_ENABLED. Contact support to turn it on, then plan again;
    • to be an Owner or Admin of your Pantech organization, allowed to create buckets (object_storage:CreateBucket) when the import makes a new one, and able to create a CloudFormation stack in AWS.

    Copying objects works from AWS S3. A scan of another cloud lists its buckets in the plan, but copy their objects yourself with an S3 tool for now: see moving by hand.

    The plan

    With object storage on, each scanned bucket is a planned bucket item. Its target is a Pantech bucket in af-abj with a valid name made from the source's (lowercase, with dots and underscores turned into hyphens, unique in the plan), the source's versioning, and the size and object count S3 reported, "as of" the day they describe (size_as_of). Its flags say what to check:

    • bucket_renamed: the name had to change. Update the tools that use the old one.
    • bucket_name_unavailable: no valid name could be made. Choose one when you start the copy.
    • bucket_public: the source is public. The Pantech bucket stays private unless you ask for public_read when you start the copy.
    • bucket_copy_access_needed: every bucket carries this until it has copy access (below).

    1. Give Pantech read access to the buckets

    The connection's read-only role can list buckets but never read what is in them. Copying needs a separate copy role, made by a second CloudFormation stack, that names exactly the buckets you choose.

    Choose the buckets (1 to 50 per connection):

    Terminal
    $ curl -X PUT https://api.pantechdynamics.com/public/v1/cloud-connections/ccn_06gk3x9tq7m2v8r4y1c5d0zp8w/copy-access \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"buckets": ["media-prod", "backups-prod"]}'

    The copy access is now awaiting role, and its setup.template is a CloudFormation template for a role that can read only those buckets. Create a stack from it, as you did for the connection (it reuses the identity provider your first stack created), then send the stack's CopyRoleArn output:

    Terminal
    $ jq -r .setup.template copy-access.json > pantech-migrate-copy.json$ aws cloudformation create-stack --stack-name PantechMigrateCopy \    --template-body file://pantech-migrate-copy.json --capabilities CAPABILITY_IAM$ aws cloudformation wait stack-create-complete --stack-name PantechMigrateCopy$ curl -X PUT https://api.pantechdynamics.com/public/v1/cloud-connections/ccn_06gk3x9tq7m2v8r4y1c5d0zp8w/copy-access \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"role_arn": "arn:aws:iam::123456789012:role/PantechMigrateCopy-PantechMigrateCopyRole-1A2B3C4D5E6F"}'

    Pantech then verifies the role against each bucket: it finds the bucket's region and versioning and lists one key, without reading any object. Follow GET /cloud-connections/{connection_id}/copy-access until its status is verified; each bucket in buckets has ready: true, or a failure saying what to fix. {"retry": true} verifies again.

    To change the list, PUT the new buckets: you get a new template, which you apply as an update to the same stack.

    What the copy role can do

    ActionsOnWhat for
    s3:ListBucket, s3:GetBucketLocation, s3:GetBucketVersioningarn:aws:s3:::<bucket>, for each chosen bucketList the keys, find the region and versioning
    s3:GetObject, s3:GetObjectTaggingarn:aws:s3:::<bucket>/*, for each chosen bucketRead each object and its tags

    There is no wildcard bucket and no parameter that widens it. The role trusts the same identity provider as your connection, but only tokens whose subject is the connection id followed by :copy, which Pantech signs for copy work only. On top of that, each copy job passes AWS a session policy naming just the one bucket it copies, so its one-hour credentials can read that bucket and no other. Old object versions are never read.

    2. Start the import

    Copy into a new Pantech bucket, made now and billed like any bucket:

    Terminal
    $ curl -X POST https://api.pantechdynamics.com/public/v1/bucket-imports \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w", "source_bucket": "media-prod", "destination_bucket_name": "media-prod", "migration_id": "mig_06gk3x9tq7m2v8r4y1c5d0zp8w"}'
    FieldWhat it is
    connection_id, source_bucketThe connection and a bucket with verified copy access
    destination_bucket_nameA new Pantech bucket to make: 3 to 63 lowercase letters, digits and hyphens
    destination_bucket_idOr an existing bucket of yours to copy into. Send exactly one of the two
    versioningVersioning on a new bucket
    public_readMake a new bucket publicly readable. Off unless you ask, even when the source was public
    migration_idThe plan the bucket is in. When the plan knows the bucket's size, an import that would not fit in your organization's remaining storage is refused at once with 403 BUCKET_IMPORT_TOO_LARGE

    A new bucket the import makes gets one lifecycle rule, pantech-migrate-abort-incomplete-uploads, which removes incomplete multipart uploads after 7 days, unless a rule for that is already there. A bucket you name is never given a rule.

    3. Follow it

    GET /bucket-imports/{import_id} shows the import. Its status is queued, then running, then succeeded, failed or cancelled.

    FieldWhat it says
    pass1 for the first copy; each resync adds one
    progressThis pass's objects and bytes: copied, skipped (already in Pantech unchanged) and failed
    total_bytes_copiedBytes copied over every pass
    failuresThe first 100 objects that failed this pass, each with a reason
    next_attempt_atWhen an import waiting on an unreachable side is tried again
    eventsWho started, resynced and cancelled it, and how each pass ended

    A pass that copied most objects but failed some still succeeds, with the failures counted: fix what they say, then resync. Imports are polled; there are no webhooks for them.

    The speed depends on the bucket's size and object count. A large bucket can take days, and the source keeps serving the whole time.

    4. Resync, then switch

    A resync runs another pass from the start. Objects Pantech already holds unchanged are skipped, so it copies only what is new or changed:

    Terminal
    $ curl -X POST https://api.pantechdynamics.com/public/v1/bucket-imports/bim_06gk3x9tq7m2v8r4y1c5d0zp8w/resync \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)"

    Resync as often as you like while the import is not running. To switch over: stop writing to the source bucket, run a last resync, wait for it to succeed, then point your application at the Pantech bucket and its S3 endpoint.

    By default nothing is ever deleted: an object you delete at the source stays in Pantech. To make Pantech match the source, send {"mirror_deletes": true} with a resync. For that pass only, once it has listed the whole source, it deletes the objects this import copied that the source no longer has, and only those still holding the bytes the import wrote. An object you changed in Pantech, or one the import did not write, is never deleted. Because it deletes, it needs the migrate:Delete action, an API key needs the delete scope, and it is recorded in the import's events.

    POST /bucket-imports/{import_id}/cancel stops an import: a queued one at once, a running one at its next checkpoint. Uploads in flight are abandoned; objects already copied stay.

    What is copied

    • Kept: each object's key and bytes, Content-Type, Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Expires, user metadata and tags (up to 10). The current version of each key only.
    • Not kept: object ACLs, object lock retention, old versions and delete markers. Set access, lifecycle rules and object lock on the Pantech bucket yourself.
    • Checked: every object is hashed as it streams and compared with what Pantech stored, and with the source's own checksum where S3 has one. Large objects are copied in parts, matching the source's own parts where it can, so their checksum matches S3's. Each read asks S3 for exactly the object it listed, so one that changes mid-copy is never stitched from two versions: it fails source_changed and is copied by the next pass.

    An object that cannot be copied is skipped with a reason, and the rest carry on:

    ReasonWhat happenedWhat to do
    object_archivedThe object is in Glacier or Deep Archive and not restoredRestore it in S3, then resync
    object_access_deniedThe copy role can't read it, usually because it is encrypted with a KMS key the role may not useLet the role use the key, then resync
    invalid_keyPantech can't store an object with this name: it holds control characters or is longer than 1,024 bytesRename it at the source, then resync
    object_too_largeLarger than a copy can take (more than about 312 GiB)Copy it yourself
    source_changedIt changed while being copiedResync once writes to it stop
    verification_failedThe copy didn't match the source, so it isn't counted as copiedResync
    transfer_failedThe copy kept failingResync
    destination_rejectedPantech object storage refused itContact support with the import id

    Limits

    • 20 imports not yet finished per organization, and one per source bucket.
    • 50 buckets in one connection's copy access.
    • Your organization's object storage limits and the bucket's own size limit apply. A destination that fills up fails the import with destination_full straight away; raise the limit or free space, then resync.
    • An import whose source or destination stays unreachable is retried a few times, then fails with provider_unavailable or destination_unavailable. Resync to try again.

    What it costs

    The move is free. Stored data in the Pantech bucket bills as usual from the moment it is there. On your AWS bill: S3's requests for each listing and object read, and data transfer out of AWS.

    When you are done

    Delete the copy stack in AWS: that removes the copy role at once. To stop copying one bucket but keep others, PUT copy access with the shorter list and update the stack. Troubleshooting has every error.

    Was this page helpful?

    Updated