close

March 2024 only! Join our Discord free of charge.

Slick­Stack
Lightning-fast WordPress on Nginx

mysqldump from managed remote database server

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #4615 Reply
    Louis
    Guest

    SlickStack supports remote database such as from DigitalOcean, what about dumping the database to local SlickStack server

    #4616 Reply
    Alice
    Guest

    Yes it’s supported recently. Before it didn’t work because SlickStack only installed mysql-server package and skipped when remote database was detected in ss-config:

    SS_DATABASE_REMOTE="true"

    But now it’s fixed.

    https://github.com/littlebizzy/slickstack/blob/master/bash/ss-dump-database.txt

    Just run ss dump database and you will see it.

    #4617 Reply
    Sophia
    Guest

    ok where are the dumped database stored?

    #4618 Reply
    Emma
    Guest

    The dumps are under /var/www/backups/mysql/ directory as .sql files.

    #4619 Reply
    Peter
    Guest

    Just to clarify, SlickStack now installs mysql-client on your machine if you have enabled remote database in your ss-config.

    Otherwise, it will install mysql-server and setup a database locally.

    See here:

    https://github.com/littlebizzy/slickstack/blob/master/bash/ss-install-mysql-packages.txt

    #4620 Reply
    Deborah
    Guest

    If anyone is wondering how SlickStack ensures this works for remote database hosts with strange names full of special characters, it’s because of this function:

    function ss_mysqldump_user {
        command mysqldump --user="${DB_USER}" --password="${DB_PASSWORD}" --host="${DB_HOST}" --protocol=tcp --port="${DB_PORT}" --no-create-db --no-tablespaces --single-transaction --dump-date --force "$@"
    }

    Calling these as variables avoids conflicts with mysqldump see this thread

    https://stackoverflow.com/questions/65595461/how-to-export-mysql-database-from-digital-ocean-managed-database

    #4659 Reply
    Diane
    Guest

    💯👍🏻

    #6552 Reply
    Frank
    Guest

    does WP-CLI take care of this

    #7103 Reply
    Janice
    Guest

    Docs page for this command:

    ss dump database

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Reply #4618 in mysqldump from managed remote database server

Thanks to our generous sponsors for their support!