Documentation > Products > RDS > Restore Backup Files to the Self-built MySQL

Restore Backup Files to the Self-built MySQL Service

You can restore the backup data of the JCS for MySQL service to the self-built database.


  • The self-built database version shall be consistent with the source database version of backup files.
  • The backup unzipping software can only be used in Linux.
  • System software of unzipping tools relies on tee and python, with version >= 2.7.
  • The current system has already been installed with percona xtrabackup >= 2.4; If not, please refer to Official Manual.

Operation Instructions

  1. See the requirements for installation environment in precautions.
  2. Download backup unzipping tools, Click to Download and unzip. The tool name is mysql_backup_extract.py, and the using instances are as follows.
    # View Help Manual
    ./mysql_backup_extract.py -h
     # Unzipping backup data of the JCS for MySQL service instance
     ./mysql_backup_extract.py  -v 5.7 -f ./backup.xbstream
3. Download backup files.
    wget -c ‘<Data backup download link>' -O <Customized backup file name>.xbstream

    -c: Start breakpoint upload
    -O: Save downloaded results as the assigned files and note that the suffix of files must be .xbstream
  1. Unzip the backup data, and the unzipped files will be saved in tmp_snapshot, a sub-directory of the current directory, assuming that the current directory is $HOME.
    ./mysql_backup_extract.py -v 5.6 -f <Customized backup file name>.xbstream
    -v Parameters may not be assigned, the default value is 5.7, and view the -h Help Manual for details of variables following -v.
  1. Restore the unzipped backup files.
    innobackupex --defaults-file=$HOME/tmp_snapshot/backup-my.cnf --apply-log $HOME/tmp_snapshot
***innobackupex completed OK!*** indicates successful execution, and you can continue to the next step.
  1. Modify the configuration file, backup-my.cnf.
    # The MySQL server
  1. Modify the file owner and confirm that files are owned by the JCS for MySQL user.
    chown -R mysql:mysql $HOME/tmp_snapshot
  1. Start the JCS for MySQL process.
    mysqld_safe --defaults-file=$HOME/tmp_snapshot/backup-my.cnf --user=mysql --datadir=$HOME/tmp_snapshot &
  1. Login the JCS for MySQL service.
    mysql -uroot -p
  • Click Enter directly due to the default blank password.
Update Time:2019-07-01 17:59:25