How to Restore Elastic VPS Backup from AccuWeb.Cloud Dashboard?
Restoring a VPS from a backup helps you get your data and functions back to a certain time, like before a hardware or software failure, data corruption, or an attack.
However, restoring will replace all current content on your server and delete any previous snapshots.
Also, any changes made after the backup will be lost. If you want to keep any recent data, download it via FTP before restoring the backup.
Restore an Elastic VPS backup with the Tar command
The tar command is used to compress files and folders in Linux. It turns multiple files or directories into a single compressed file. You can use it to decompress the archive, list all files in it, and add files to it. System administrators often use the tar command to create and restore server backups.
Steps to Restore a Backup on AccuWeb.Cloud
Step 1: Upload the backup file from your local system to your AccuWeb.Cloud account using an FTP account.
Step 2: Log into your AccuWeb.Cloud dashboard and select the environment where you want to restore the web content (files).
Step 3: Navigate to the Application Server and click on the Web SSH option.
Step 4: In the Web SSH terminal window, navigate to the directory where you uploaded the file via FTP. The default FTP account path is /var/ftp/.
Use the ls command to list the files and confirm that the backup file is present in the default FTP directory.
Step 5: Enter the following command in the terminal to restore the backup and press Enter:
# tar xvpfj backup.tar.bz2
This command will extract backup.tar.bz2 in the current folder. To extract it in a specific folder, use the ‘-C’ option followed by the folder path. In the example below, we are extracting system-back.tgz into the /var/www/accuwebtraining.com/ folder.
# tar xvpfj backup.tar.bz2 -C /path/foldername
Explanation of the command:
- tar: Command to create and extract archive files
- xvpfj: Options to extract the archive, preserve permissions, and use bzip2 compression
- backup.tar.bz2: Name of the backup file
- /path/foldername: Directory where the backup should be restored
Example:
# tar xvpfj accuwebtraining-site-backup.tar.bz2 -C /var/www/accuwebtraining.com/
Step 6: Navigate to the directory where you restored the backup file and use the ls command to verify the file has been extracted.
Step 7: Open the folder (var) and move the files to the web server’s document root.
Go to the path (var/www/accuwebtraining.com/public_html/) in the terminal and type the ls command.
To move the files to the web server documents root folder, type the following command in the terminal.
# mv * /var/www/accuwebtraining.com/public_html/
If the file or folder already exists in the destination folder, it will ask whether you want to overwrite it. You need to press Y if you want to overwrite it; otherwise, press N.
Once you restore the files in the document root, you can browse the website or application to check whether it is working or not.
Database Restore
Step 1: Upload the database backup file from your local system to your AccuWeb.Cloud account using an FTP account.
Step 2: Log into your AccuWeb.Cloud dashboard and select the environment where you want to restore the database.
Step 3: Navigate to the Application Server and click on the Web SSH option.
Step 4: In the Web SSH terminal window, navigate to the directory where you uploaded the file via FTP. The default FTP account path is /var/ftp/. Use the ls command to list the files and confirm the backup file is present.
Step 5: Enter the following command in the terminal to restore the database and press Enter:
# mysql -u database_username -p database_name < /path/database_backup_file.sql
For example:
# mysql -u root -p accuwebtest_db < autotrade_db.sql
You will be prompted to enter the database user’s password. Enter the password and press Enter.
Step 6: If no error message appears and you receive a blank response, the database restoration process has been completed successfully.
Conclusion
To restore a VPS from the Accuweb.cloud dashboard, upload the backup file via FTP, log into AccuWeb.Cloud dashboard, navigate to where you uploaded the backup file, select the backup, and confirm the restoration. Ensure you have saved any important data beforehand, as this process will overwrite all current content on your server.