creame / trellis-simple-sync

Ansible playbooks for Trellis database and uploads sync. Just copy and run without any extra configuration.
MIT License
39 stars 5 forks source link

Add conditional to prevent skipping GUIDs #9

Closed robrecord closed 2 years ago

robrecord commented 2 years ago

If skip_guid is passed as false, GUIDs will not be skipped

Usage: sync.sh db <push|pull> --extra-vars "skip_guids=false"

Fixes #8 and #7 Replaces #6

pacotole commented 2 years ago

Thank you! It is a good contribution but I think that skip_guids_column should be false by default. The usual workflow is in production to use the production domain.

It could be usefull for some cases (like migrations) where you need to keep the GUIDs but the usual is to replace the development GUIDs by the production ones. And when syncs prod => dev => prod the final GUIDs have not changed.

robrecord commented 2 years ago

OK fair point; I think the decision was the opposite in the wp-cli repository which is why I went this way.

I will switch it when i have a minute.

Thanks

robrecord commented 2 years ago

I think the rationale was that it doesn't matter what the GUID is, only that it doesn't change once it's been out "in the wild", on production. So I still think it shouldn't be altered by default because it's a disruptive change.

Even if a post was created on dev, then pushed to prod, the GUID being a dev URL wouldn't be a problem. But if the GUID from production was a non-prod URL, then pulled down and pushed back up and modified in the process, that could be a problem to feed readers.

Unless you think that is too unlikely to be an issue. What do you think?

pacotole commented 2 years ago

I think it's very unlikely.

I also don't think it's appropriate to publicly reveal development/staging urls.

For example, we create almost all the content initially on the staging server and then we synchronize stag => dev => prod and we are not interested in revealing our staging urls.

As I said at the beginning I see it very useful for a migration or change of domain.

robrecord commented 2 years ago

Thanks @pacotole

Apologies for the delay; I have changed this behaviour as suggested.