The following is the GNU All-permissive License as recommended in https://www.gnu.org/licenses/license-recommendations.en.html

Copyright (C) 2024 Free Software Foundation sysadmin@fsf.org

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See https://savannah.gnu.org/maintenance/fsf/.

mydumper and myloader

Dump

We use the multi-threaded mydumper to regularly backup MySQL DBs on gnuhope. See /usr/local/bin/dump-mysql for details.

Load

If you are loading a DB backup from another host onto a dev machine, the DB can be loaded in like so:

cd 2021052513

# you may wish to drop the old db first if it doesn't have production data

echo "CREATE DATABASE shop" | mysql
mysql shop < schemas/shop.sql

# we don't want to overwrite our local 'mysql' table
mkdir ../2021052513-bak
mv mysql.* ../2021052513-bak

# import the data
myloader -d . -B shop -s shop