Skip to content

[wip] feat: add multi-site sync script - #11

Closed
kellymears wants to merge 4 commits into
masterfrom
multi-script
Closed

kellymears wants to merge 4 commits into
masterfrom
multi-script

Conversation

@kellymears

@kellymears kellymears commented May 6, 2022 •

Copy link
Copy Markdown

allows for multiple url replacements.

everything is configured in sync.json:

{
  "uploads": "web/app/uploads/",
  "connection": {
    "development": "[email protected]:/srv/www/example.com/shared/uploads/",
    "staging": "[email protected]:/srv/www/example.com/shared/uploads/",
    "production": "[email protected]:/srv/www/example.com/shared/uploads/"
  },
  "secure": {
    "development": false,
    "staging": true,
    "production": true
  },
  "sites": [
    {
      "production": "example.com",
      "staging": "staging.example.com",
      "development": "example.test"
    }
  ]
}

If syncing between two environments that don't share a secure setting, there is a second wp search-replace to change the protocol.

example (from staging to development):

  • staging.example.com => example.test
  • https://example.test => http://example.test

requirements

  • newer bash
  • jq

Mac users (and linux users with brew) can run brew install jq bash.

Installing bash is necessary on macos but probably unneeded on most relatively recent linux installs.

@kellymears kellymears closed this Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant