[MDEV-18329] Backup/Restore Single Database as Different Name Created: 2019-01-21  Updated: 2024-01-11

Status: Open
Project: MariaDB Server
Component/s: mariabackup
Fix Version/s: None

Type: New Feature Priority: Critical
Reporter: Nuno Assignee: Ralf Gebhardt
Resolution: Unresolved Votes: 4
Labels: innodb

Issue Links:
Duplicate
duplicates MDEV-18762 Support easy restore of partial backup Closed
Relates
relates to MDEV-11658 Simpler, faster IMPORT of InnoDB tables Open

 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.



 Comments   
Comment by Nuno [ 2019-02-15 ]

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.

Comment by Geoff Montee (Inactive) [ 2019-09-25 ]

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

Generated at Thu Feb 08 08:43:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.