To restore databases older than the last 24 hours, simply use Veeam or R1Soft to restore the cpmove file/s located in /home/r1softtemp from an older restore point. Once the older cpmove file is restored you can continue the guide below.
For databases specifically, you have the option of using the cpmove file that resides within the /home/r1softtemp directory.
Example:
To restore using the database from the cpmove file within /home/r1softtemp, you can extract the SQL using the following method.
Find your user (I will be using "acctest" for this example). Then find the cPanel account, along with the time the backup was done using the below example.
# cd /home/r1softtemp/
# ls acctest -lah
root@server [/home/r1softtemp]# ls acctest -lah
-rw------- 1 root root 6.3M May 6 02:26 cpmove-acctest.tar.gzYou will see that there is a backup from 2:26 AM, on May 6th.
To list the SQL files within this backup, you can use the following command against the cpmove file.
# tar tf cpmove-{USER}.tar.gz | grep sql | grep -v 'timestamps\|.create'
root@server [/home/r1softtemp]# tar tf cpmove-acctest.tar.gz | grep sql | grep -v 'timestamps\|.create'
cpmove-acctest/psql_grants.sql
cpmove-acctest/mysql/
cpmove-acctest/mysql/openfileslimit
cpmove-acctest/mysql/acctest_test.sql
cpmove-acctest/mysql.sql
cpmove-acctest/psql/
cpmove-acctest/psql_users.sqlThis gives a list of all available databases (excluding 'mysql-timestamp' files and '.create' files, which are not required for us).
If I want to extract the acctest_test database, I would use the following command
# tar xzvf cpmove-acctest.tar.gz cpmove-acctest/mysql/acctest_test.sqlAs you can see, this extracts only the file itself.
root@server [/home/r1softtemp]# find cpmove-acctest
cpmove-acctest
cpmove-acctest/mysql
cpmove-acctest/mysql/acctest_test.sqlTo restore this file, it is recommended to take a backup of the already existing database in case you run into any problems:
# mysqldump acctest_test > /home/acctest/acctest_test.BAK20140506.sqlYou will then be able to restore the database using the following command:
# mysql acctest_test < cpmove-acctest/mysql/acctest_test.sqlDepending on the size of the database file, it may take a few seconds or a few minutes to complete successfully - some patience may be required.