Skip to main content

Backup and Restore

Backup

Backing up Bookstack is pretty striaght forward. Simply backup the Bookstack database and the Bookstack /var/www folder, and you'll be good to go. 

Official Documentation: https://www.bookstackapp.com/docs/admin/backup-restore/ 

Backup the Database

To backup the database, you can use the mysqldump command to dump the database into a file:

sudo mysqldump -u root bookstack > bookstack.backup.sql

Screenshot_2024-04-28_222949.png

Backup the /var/www/Bookstack folder

To backup the /var/www/Bookstack folder, you can tar the whole folder and copy the tar file to a different device:

sudo tar -czvf bookstack.tar.gz /var/www/BookStack

Screenshot_2024-04-28_153151.png

Restore to New Installation

To restore from the above backups to a new installation, follow the manual installation steps to the end, but do not run the php artisan migrate command yet. 

Once you have a fresh installation ready, restore the database and copy over the /var/www/Bookstack folders. 

Restore database
sudo mysql -u root bookstack < bookstack.backup.sql

Screenshot_2024-04-28_223454.png

Restore the /var/www/Bookstack folder
sudo tar -xvzf bookstack.tar.gz --directory /var/www/

Screenshot_2024-04-28_203424.png

Run the php artisan migrate command

Chnage into the Bookstack folder, then run the command:

php artisan migrate

Screenshot_2024-04-28_211028.png