Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve db scripts #2608

Merged
merged 10 commits into from
May 26, 2022
Merged

Improve db scripts #2608

merged 10 commits into from
May 26, 2022

Conversation

msaggiorato
Copy link
Member

This is a backport from the port I've made of this scripts from VVV into a docker solution we're currently using (and I intend to slowly port back to VVV).

Basically allows to:

Allow to restore specific databases with db_restore

By running db_restore db_name_1 db_name_2 you can only restore specific databases only.

Force restoration when running db_restore

This allows to run db_restore --force or db_restore -f to delete all databases being restored before restoring them. Allows to easily force restore to a dump. Most useful in conjunction with specific databases usage

Minor other improvements

  • Skip sys database when backing up or restoring.
  • Root user now also has .my.cnf file in their home dir which grants mysql default user password (root / root).
  • Due to the above, all mysql commands run in provisioners do not require user and password. Removed.
  • When backing up, count should start at 1 (not 0)
  • Normalized wording of exclude/skip on the restore script.

Didn't test this myself on VVV (because i cannot run it right now). Will see how the provisioner goes, but none of these changes should be breaking.

Once we agree if this is to be merged, I'll update the CHANGELOG.md file.

Checks

  • I've updated the changelog.
  • I've tested this PR
  • This PR is for the develop branch not the stable branch.
  • This PR is complete and ready for review.

@msaggiorato msaggiorato requested review from tomjn, Mte90 and a team May 16, 2022 01:06
@update-docs
Copy link

update-docs bot commented May 16, 2022

Thanks for opening this pull request! Make sure CHANGELOG.md gets updated with this change, additionally any docs that need updated can be found at https://github.com/Varying-Vagrant-Vagrants/varyingvagrantvagrants.org

GitHub
The VVV docs and website. Contribute to Varying-Vagrant-Vagrants/varyingvagrantvagrants.org development by creating an account on GitHub.

@tomjn
Copy link
Member

tomjn commented May 16, 2022

Not sure why the provisioners are failing with /srv/provision/provision-helpers.sh: line 314: $2: unbound variable but probably related to set -u

@msaggiorato
Copy link
Member Author

Fixed undefined variable issues

@msaggiorato msaggiorato force-pushed the improve-db-scripts branch from 08029ae to 0117119 Compare May 16, 2022 19:04
@tomjn tomjn added this to the 3.10 milestone May 17, 2022
@tomjn tomjn merged commit 0000e5d into develop May 26, 2022
@tomjn tomjn deleted the improve-db-scripts branch June 15, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants