• While setting up our production/staging/develop environments, and some scripts that are syncing from production->Staging and production->development, we came upon the following puzzles:
    We use a different bucket for each environment. We clone the bucket (So they have the same contents). We can update the public urls of the images with a wp search-replace $OLD_PATH $NEW_PATH --precise --skip-columns=guid
    But this leaves the bucket field of each image still pointing to the source bucket.

    We tried testing updating all occurencies of the old bucket in the database, but this was breaking the sm_cloud param of the meta values (So wp post meta get ID sm_cloud was returning empty after the brute force replacement).

    Questions:
    1) Why does each image need to have it’s own bucket declaration, since the system has the bucket option on a site level?
    2) Is there any functionality for switching bucket of any (or all) images? (Switching all the needed data, without breaking the image, without trying to do any move).
    3) Are there any dangers if we leave the bucket field as it is, and only change the actual url of the image?
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Further to the above, it seems it’s possible to fix buckets after a move by running the Sync command from WP Stateless settings.

    Is there any way of calling this function in an automation environment – API, wp-cli etc?

    (I have this same question, I think.) Why does each image need to have it’s own bucket declaration, since the system has the bucket option on a site level?

    Hello everyone, sorry for the late replay.

    1. Bucket name is used to verify that image is from same bucket when deleting the image.
    2. As @raywalker suggested, after changing the bucket name just sync all the images again from Sync tab.
    3. No there aren’t any danger. Just do a sync and everything would be as expected.

    The image URL isn’t generated dynamically using bucket name, we just get it from sm_cloud meta.

    @raywalker sorry there isn’t any automated way yet, but we have plan to build one.

    @maxfenton check no 1.

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Switch bucket functionality’ is closed to new replies.