Introduction
You may have need to restore a RoundCube database should it become corrupt or otherwise irreparable. The following procedure can help you restore a backup of the database.
Procedure
RoundCube data is stored in the following folder, where $user is the cPanel user, and $domain is the domain that contains the email address you are working with:
/home/$user/etc/$domain/
To restore to a previous version, either from the automatic copies made or from a backup:
- Access the server via SSH as the root user and navigate to the folder described above.
- Rename the database file to get it out of the way without deleting it, where $email_user is the address that has a corrupt database:
mv $email_user.rcube.db{,.$( date +%Y%m%d )} -v
Note: If you want to use or generate a new database from this point, you can log into Webmail, and a new database will be created. Proceeding with the following steps after generating a new database won't be necessary.
- If a backup exists, they will be listed alongside this backup with timestamps like this:
-rw------- 1 user user 512000 Jan 21 19:52 emailuser.rcube.db
-rw------- 1 user user 466944 Jul 31 2024 emailuser.rcube.db.1722461863
-rw------- 1 user user 491520 Oct 31 22:36 emailuser.rcube.db.1730428585 - Rename one of the backup files to $email_user.rcube.db to replace the old database:
mv $email_user.rcube.db.$timestamp $email_user.rcube.db -v
- Log in to RoundCube normally
Copies of your RoundCube database can also be found in any full cpmove backup under the following folder (you may need to open this file using your preferred archive utility).
homedir/etc/<domain>/<user>rcube.db
Additional Information
For more information on how to extract the files from an existing backup, please refer to the article below:
How to manually extract individual files from a cPanel backup with the tar utility
Comments
0 comments
Article is closed for comments.