Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-18329

Backup/Restore Single Database as Different Name

Details

    • New Feature
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • None
    • mariabackup

    Description

      I believe at the moment it is not be possible to restore a single database from a Backup, without clearing all other databases in the server (because we need to empty the target directory first).
      Are there any plans of implementing this in the future?

      For example, it would be GREATLY convenient to backup "MyDatabase", and restore it as "MyDatabase_restore" (without affecting any existing database). This can be very helpful if something went wrong with a DDL change, and I need to recreate it and copy data from the previous backup to the main database.

      Attachments

        Issue Links

          Activity

            nunop Nuno added a comment -

            From my understanding, this could be "easily" automated.

            The Backup and Prepare steps are already developed, as per:
            https://mariadb.com/kb/en/library/partial-backup-and-restore-with-mariabackup/

            As for the Restore step, if we are restoring a full database, we probably need to:

            • CREATE DATABASE xxx
              (depending on the name we decide for the new database)
            • CREATE TABLE xxx
              (for each table)
            • DISCARD TABLESPACE
            • copy
            • IMPORT TABLESPACE

            If it's THIS simple, this could very well be automated.

            MariaBackup could generate "CREATE TABLE" scripts for every table at the time the Backup is made, and save in some folder inside the backup.

            nunop Nuno added a comment - From my understanding, this could be "easily" automated. The Backup and Prepare steps are already developed, as per: https://mariadb.com/kb/en/library/partial-backup-and-restore-with-mariabackup/ As for the Restore step, if we are restoring a full database, we probably need to: CREATE DATABASE xxx (depending on the name we decide for the new database) CREATE TABLE xxx (for each table) DISCARD TABLESPACE copy IMPORT TABLESPACE If it's THIS simple, this could very well be automated. MariaBackup could generate "CREATE TABLE" scripts for every table at the time the Backup is made, and save in some folder inside the backup.

            This could probably be considered a duplicate of MDEV-18762.

            GeoffMontee Geoff Montee (Inactive) added a comment - This could probably be considered a duplicate of MDEV-18762 .

            People

              Unassigned Unassigned
              nunop Nuno
              Votes:
              4 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.