This is an old revision of the document!
====== How to Restore System from a Backup File ====== ===== Install a Same Version Astercc ===== For details:[[en:download_and_install:installation|asterCC Installation]] ===== Upload the Backup File to the New Server ===== For details:[[en:use_case:how_to_perform_system_backup|How to perform asterCC system backup]] ===== Untar the Backup File ===== First,you should enter the directory of the backup files that download via "wget" command,then execute commands following: <code> tar -xzvf astercc_files.tar.gz </code> ===== Restore Database ===== ==== Untar the Backup File of Database ==== After untar the backup file,we will untar the archive of database,we just need to execute commands following: <code> gunzip -c astercc_db.sql.gz > astercc_db.sql </code> If finished,you can find the database file named "astercc_db.sql". ==== Import the Backup File of Database ==== Import backup files into the database through commands following: <code> mysql -u root -p astercc10 < XXXX.sql </code> By the way,"astercc10" is the database name on the new server,"XXXX" is the file unzip from backup file of database,for example,here is "astercc_db",So: <code> mysql -u root -p astercc10 < astercc_db.sql </code> At last,it prompts us to enter the secret of database.Under normal circumstances,the default secret is "astercc".Now,the importing of database is finished.We need modify 3 configurations of the new server manually which different from the old one: 1.In astercc.conf→[database],such as:dbname、username、password <code> vim /opt/asterisk/scripts/astercc/astercc.conf </code> 2.In astercc.conf→[statistics],for example:dbname、dbpassword <code> vim /opt/asterisk/scripts/astercc/astercc.conf </code> 3.At bottom of database.php,Under "class DATABASE_CONFIG -> default",for example:password、database <code> vim /var/www/html/asterCC/app/config/database.php </code> ===== Restore Folder ===== Execute the following command one by one: <code> \cp -rpf ./etc/* /etc </code> <code> \cp -rpf ./opt/* /opt </code> <code> \cp -rpf ./var/* /var </code> ===== Reload the Configure Files of System ===== After finished operations above,we should reloading the configure of system next. We just find "reloadconf.sh" in /opt/asterisk/scripts/astercc/ ,and execute it by "./" <code> ./reloadconf.sh </code> ===== Solutions for Problems =====