https://github.com/creativecommons/sre-wp-pull
Creative Commons Site Reliability Engineering WordPress Data Pull
https://github.com/creativecommons/sre-wp-pull
bash wordpress-sync
Last synced: 20 days ago
JSON representation
Creative Commons Site Reliability Engineering WordPress Data Pull
- Host: GitHub
- URL: https://github.com/creativecommons/sre-wp-pull
- Owner: creativecommons
- License: mit
- Created: 2019-06-19T20:08:40.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T11:33:29.000Z (10 months ago)
- Last Synced: 2025-04-21T12:38:20.589Z (10 months ago)
- Topics: bash, wordpress-sync
- Language: Shell
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# sre-wp-pull
Creative Commons Site Reliability Engineering WordPress Data Pull
> :warning: **Destroys and replaces destination data**
## Code of Conduct
[`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md):
> The Creative Commons team is committed to fostering a welcoming community.
> This project and all other Creative Commons open source projects are governed
> by our [Code of Conduct][code_of_conduct]. Please report unacceptable
> behavior to [conduct@creativecommons.org](mailto:conduct@creativecommons.org)
> per our [reporting guidelines][reporting_guide].
[code_of_conduct]:https://opensource.creativecommons.org/community/code-of-conduct/
[reporting_guide]:https://opensource.creativecommons.org/community/code-of-conduct/enforcement/
## Contributing
See [`CONTRIBUTING.md`](CONTRIBUTING.md).
## Assumptions
1. `DEST_HOST`:
1. Web hosting and WordPress are configured independently (ex. by
SaltStack)
- `wp-config.php` is already setup
- user has appopriate permissions (ex. member of `www-data`)
- [WP-CLI][wp-cli] is already installed
2. You may need to configure your `.ssh/config`. For example,
`chapters_stage` requires the following entry:
```
Host 10.22.10.14
ProxyJump 10.22.10.10
```
2. `SOURCE_HOST`:
1. WordPress source data was created using
[/states/wordpress/files/backup_wordpress.sh][backup] found in the
[creativecommons/sre-salt-prime][salt-prime] repository.
[wp-cli]: https://wp-cli.org/
[salt-prime]: https://github.com/creativecommons/sre-salt-prime
[backup]: https://github.com/creativecommons/sre-salt-prime/blob/master/states/wordpress/files/backup_wordpress.sh
## Use
1. `SOURCE_HOST`: *(optional)*
- run [`backup_wordpress.sh`][backup]
2. Local/laptop:
1. Clone this repository
2. Prepare configuration file
1. Make a copy of one of the appropriate
[`config_examples/`](config_examples/)
2. Replace `FILEPATH` and `USERNAME` with your information
3. Ensure `SOURCE_DB_FILE` and `SOURCE_UPLOADS_FILE` are valid files on
the `SOURCE_HOST` (ex. by completing step 1, above)
3. Execute script with config file as only argument. For example:
```shell
./wp-pull.sh chapters__stage
```
# Alternatives
(Only documenting CLI utitilities here. There are also many WordPress plugins
devoted to migrating, mirroring, and syncing.)
- [jplew/SyncDB][syncdb]: Bash script meant to take the tedium out of deploying
and updating database-driven (eg Wordpress) websites. It rapidly synchronizes
local and remote versions of a MySQL database, performs the necessary search
and replace queries, then synchronizes all your uploads/binaries.
[syncdb]: https://github.com/jplew/SyncDB
## License
- [`LICENSE`](LICENSE) (Expat/[MIT][mit] License)
[mit]: http://www.opensource.org/licenses/MIT "The MIT License | Open Source Initiative"