Bookstack restore unable to restore DB #4726

Closed
opened 2026-02-05 09:12:31 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @niladrishekhar on GitHub (May 2, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

A series of unfortunate events led me to discard the current installation and retry a fresh installation.
I was able to retain the .env file and the datbase dump using mysqldump.
I was not able to retain the following -
storage/
bootstrap/cache
public/uploads

So I have tried the following approaches - all the time with a fresh install (not only BookStack but dropping the DB - creating new DB with the same name flushing privileges etc.)

  1. Installed BookStack - and then uploaded the mysql file using mysqldump - system takes me to the Log In Screen - entering the userid password it shows a error 500 - no nginx error log file
  2. Installed BookStack - and then load mysql dump file and then run php artisan migrate - gives an error message - trying to access page gives error 500
                                   APPLICATION IN PRODUCTION.                                     
                                                                                                   

 Do you really wish to run this command? (yes/no) [no]
❯ yes

  INFO  Running migrations.  

 2022_08_17_092941_create_references_table ............................................ 24ms FAIL

In Connection.php line 760:
                                                                                                  
 SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'references' already exists (SQL  
 : create table `references` (`id` bigint unsigned not null auto_increment primary key, `from_id  
 ` int unsigned not null, `from_type` varchar(25) not null, `to_id` int unsigned not null, `to_t  
 ype` varchar(25) not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')           
                                                                                                  

In Connection.php line 545:
                                                                                             
 SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'references' already exists  

Approach 3 - Installed BookStack - ran php artisan migrate - tables getting created - was able to log in using admin@admin.com and password. Application was blank no data as the mysql dump file is not loaded. I then loaded the mysql dump file and then tried accessing again. the Log in Page opens - on entering user id password and trying to log in gives errror 500.

I have attached the Laravel Log for the last approach. I am not sure what to do next. Can you please help.
In all the above approached I have followed the installation instruction to the book - putting the .env file php artisan key generate, giving access to files etc.

laravel.log

Exact BookStack Version

BookStack v24.02.3

Log Content

No response

Hosting Environment

root@Cerulean:/var/www/BookStack# php -v
PHP 8.1.28 (cli) (built: Apr 24 2024 19:25:57) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.28, Copyright (c), by Zend Technologies
root@Cerulean:/var/www/BookStack# nginx -v
nginx version: nginx/1.22.1
root@Cerulean:/var/www/BookStack# mysql --version
mysql  Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper

MXLinux

Originally created by @niladrishekhar on GitHub (May 2, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario A series of unfortunate events led me to discard the current installation and retry a fresh installation. I was able to retain the .env file and the datbase dump using mysqldump. I was not able to retain the following - storage/ bootstrap/cache public/uploads So I have tried the following approaches - all the time with a fresh install (not only BookStack but dropping the DB - creating new DB with the same name flushing privileges etc.) 1. Installed BookStack - and then uploaded the mysql file using mysqldump - system takes me to the Log In Screen - entering the userid password it shows a error 500 - no nginx error log file 2. Installed BookStack - and then load mysql dump file and then run php artisan migrate - gives an error message - trying to access page gives error 500 ``` APPLICATION IN PRODUCTION. Do you really wish to run this command? (yes/no) [no] ❯ yes INFO Running migrations. 2022_08_17_092941_create_references_table ............................................ 24ms FAIL In Connection.php line 760: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'references' already exists (SQL : create table `references` (`id` bigint unsigned not null auto_increment primary key, `from_id ` int unsigned not null, `from_type` varchar(25) not null, `to_id` int unsigned not null, `to_t ype` varchar(25) not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci') In Connection.php line 545: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'references' already exists ``` Approach 3 - Installed BookStack - ran php artisan migrate - tables getting created - was able to log in using admin@admin.com and password. Application was blank no data as the mysql dump file is not loaded. I then loaded the mysql dump file and then tried accessing again. the Log in Page opens - on entering user id password and trying to log in gives errror 500. I have attached the Laravel Log for the last approach. I am not sure what to do next. Can you please help. In all the above approached I have followed the installation instruction to the book - putting the .env file php artisan key generate, giving access to files etc. [laravel.log](https://github.com/BookStackApp/BookStack/files/15191168/laravel.log) ### Exact BookStack Version BookStack v24.02.3 ### Log Content _No response_ ### Hosting Environment ``` root@Cerulean:/var/www/BookStack# php -v PHP 8.1.28 (cli) (built: Apr 24 2024 19:25:57) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.28, Copyright (c) Zend Technologies with Zend OPcache v8.1.28, Copyright (c), by Zend Technologies ``` ``` root@Cerulean:/var/www/BookStack# nginx -v nginx version: nginx/1.22.1 ``` ``` root@Cerulean:/var/www/BookStack# mysql --version mysql Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper ``` MXLinux
OVERLORD added the 🐕 Support label 2026-02-05 09:12:31 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4726