Restore of Bookstack from Ubuntu to Docker - login fails - 2FA #3724

Closed
opened 2026-02-05 07:14:54 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @milanLFC on GitHub (Apr 1, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hi
I need some help in understanding what I am doing wrong.
I have a backup of the mysql db, and a backup of the upload files for a bookstack install on ubuntu.
I am trying to migrate everything on to a docker container and using a different url to access the new instance

I am using the latest docker container install from the recommended repo.

Method of install:
I first install the db within docker
I then restore the db backup (i have check the restore has worked correctly)
I then install the docker instance of bookstack
and then I copy over the files

I DO NOT modify the .env created by the docker install.

I then use the web portal to login using an existing user.
I enter in the MFA code and get an error message on the screen which doesnt tell me much. So locked out of the new install.

I've tried various things such as php artisan migrate ... which says that there is "nothing to do".

I assume the new url and 2fa is the issue

Any ideas what I might be doing wrong, and how to overcome this ?
Before taking a backup, should i disable 2FA for the user ?
Can i do that via command line ? (The whole process above is via an ansible script)

Exact BookStack Version

v23.02.2

Log Content

No response

PHP Version

8.1.17

Hosting Environment

Source platorm:
Ubuntu vm on ESXi, with BookStack installed directly on the OS

Target platform:
Ubuntu VM on ESXi
VM contains a docker container with mariaDB and a docker container with bookstack.

Originally created by @milanLFC on GitHub (Apr 1, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Hi I need some help in understanding what I am doing wrong. I have a backup of the mysql db, and a backup of the upload files for a bookstack install on ubuntu. I am trying to migrate everything on to a docker container and using a different url to access the new instance I am using the latest docker container install from the recommended repo. Method of install: I first install the db within docker I then restore the db backup (i have check the restore has worked correctly) I then install the docker instance of bookstack and then I copy over the files I DO NOT modify the .env created by the docker install. I then use the web portal to login using an existing user. I enter in the MFA code and get an error message on the screen which doesnt tell me much. So locked out of the new install. I've tried various things such as php artisan migrate ... which says that there is "nothing to do". I assume the new url and 2fa is the issue Any ideas what I might be doing wrong, and how to overcome this ? Before taking a backup, should i disable 2FA for the user ? Can i do that via command line ? (The whole process above is via an ansible script) ### Exact BookStack Version v23.02.2 ### Log Content _No response_ ### PHP Version 8.1.17 ### Hosting Environment Source platorm: Ubuntu vm on ESXi, with BookStack installed directly on the OS Target platform: Ubuntu VM on ESXi VM contains a docker container with mariaDB and a docker container with bookstack.
OVERLORD added the 🐕 Support label 2026-02-05 07:14:54 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Apr 1, 2023):

Hi @milanLFC,
Ensure your new instance .env file is using the APP_KEY value of the old setup .env file.
That config option is used for encryption of MFA details, so is what I assume is the issue here.

Alternatively, there is a command to reset MFA methods for a user:
https://www.bookstackapp.com/docs/admin/commands/#reset-user-mfa-methods

@ssddanbrown commented on GitHub (Apr 1, 2023): Hi @milanLFC, Ensure your new instance `.env` file is using the `APP_KEY` value of the old setup `.env` file. That config option is used for encryption of MFA details, so is what I assume is the issue here. Alternatively, there is a command to reset MFA methods for a user: https://www.bookstackapp.com/docs/admin/commands/#reset-user-mfa-methods
Author
Owner

@milanLFC commented on GitHub (Apr 1, 2023):

Wow 1am response. Many thanks Dan. Will give it a go via the ansible script.

@milanLFC commented on GitHub (Apr 1, 2023): Wow 1am response. Many thanks Dan. Will give it a go via the ansible script.
Author
Owner

@ssddanbrown commented on GitHub (Apr 6, 2023):

Will go ahead and close this off. Feel free to still comment though if further help is needed and this needs to be re-opened.

@ssddanbrown commented on GitHub (Apr 6, 2023): Will go ahead and close this off. Feel free to still comment though if further help is needed and this needs to be re-opened.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3724