Bubka / 2FAuth

A Web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
https://docs.2fauth.app/
GNU Affero General Public License v3.0
2.28k stars 152 forks source link

Migrate 2fauth to a new server #341

Closed kyledam closed 5 months ago

kyledam commented 5 months ago

I'm having trouble to move the 2fauth server to another server, I use mysqldump to backup all the database '2fauth' and import it to the new server but it didn't work Please tell me the propper way to do it

kyledam commented 5 months ago

I use self-hosted installation

Bubka commented 5 months ago

Hi, When you write it didn't work, can you please be more precise about what happens?

Bubka commented 5 months ago

After a week without update I assume you have solved this on your own.

For those interested in such a move, here is what I would recommend:

  1. Backup your current database. Just to be sure you can rollback everything to a working setup.
  2. Then create a new dump of your database, but without the structure. Only export the data, from all tables except the migrations one
  3. Edit your .env file and change the MySQL setup to point to the new sql server
  4. In a terminal, run php artisan config:clear
  5. Then run php artisan migrate.
  6. Import the dump into MySQL
  7. Open 2FAuth, you should be able to sign in.