Restore to new server

hi all,

so looking at this guide

im lost at step 4 as this is a brand new server with bitwarden installed, so my mysql container is brand new and does not contain any backups

i have the tar file of all my bwdata folder tho

thanks,
tony

hello @tonykaro

Being that this is a new Bitwarden server instance you would be right that the SQL container would not have any backups.
You may be able to simply restore the .BAK from a previous nightly restore in the original server, as you say you have the .tar backup file of your bwdata directory and then proceed on with the restore process as documented.

Though this documentation linked is for restoring a nightly backup on the existing server, for your use case I would check out instead the Host-to-host migration option in the documentation, as this should fit your use case exactly and hopefully will provide you with better instructions to properly migrate your old Bitwarden server to a new server.

ok my bad, so thats restoring nightly backups to the original server, would it be the same principle then if im restoring the nightly backup to a new server

EDIT -

wow, so its just as easy as copying/replacing the new bwdata with the old bwdata and thats it?

as suggested by here

reading the tab “host to host”

Correct, nightly backups are for a use-case typically of restoring on the same server instance in the case something got messed up beyond repair.

Again as the host-to-host option shows in the Migration Procedure you could probably restore the nightly backup to a new server after Bitwarden was installed, but the migration procedure would be sure to grab the latest data currently.
Especially in the case you have multiple users who may have updated some records between the nightly backup, and your migration from one host to the new host.

Yup, pretty much. That is part of the beauty of docker.
Just be sure to stop your Bitwarden instance first, this should properly close any connections from any users who may be logged in and also be sure to prevent any changes once you migrate.

Nightly backups are also safe as I understand they are a safe snapshot of the database used by Bitwarden. If you simply use any type of software i.e. rsync to copy the /bwdata directory while your Bitwarden instance is running, you can run the risk of database corruption.
You will either want to use a nightly backup, which properly freezes the SQL database and makes the copy; or stop the service and then migrate.

Hopefully that gets you by pretty well, best of luck :smiley:

great thanks @cksapp you’ve been of great help

i think i will do a “host to host” nighlty backup restore, otherwise if that fails, i will replace the new /bwdata with old /bwdata

the reason why, is because i stupidly made it via the docker stub manual way

and as i made this ages ago, it hasnt got some of the dockers as i had to

docker pull …
docker save…
docker load…

the ones i missed are sso, k8 proxy, key connector

will this matter

thanks,
tony

Sorry for the delayed reply, this should not matter.
If you did not pull those originally with the manual docker stub method then you will most likely only have the relevant data you need such as ./bwdata/env, ./bwdata/core/attachments, and ./bwdata/mssql/data.

The ./bitwarden.sh easy install script should pull all the needed containers; SSO, K8 proxy, and key connector, etc. then you should be able to restore the original data as described.

If you have any issues with your self-hosted instance restore, another option you can always reach out directly to Bitwarden’s official support team for further help and assistance.

1 Like