Compare commits

...

7 Commits

Author SHA1 Message Date
Michiel Hazelhof
cabadea525
Merge d7430bddd7 into 29add24126 2025-08-14 16:40:56 +02:00
Michiel Hazelhof
d7430bddd7
Add potentially correct line 2025-08-14 13:30:57 +02:00
Michiel Hazelhof
2cc20501a0
Add proper line endings 2025-08-14 13:19:13 +02:00
Michiel Hazelhof
7ca7db3932
Add more documentation 2025-08-14 13:17:25 +02:00
Michiel Hazelhof
1d268957fd
Add comment 2025-08-14 11:42:04 +02:00
Michiel Hazelhof
b233e55a6e
Fix character check 2025-08-14 11:40:31 +02:00
Michiel Hazelhof
f059d756f7
Check for the correct file 2025-08-14 11:38:09 +02:00
2 changed files with 45 additions and 3 deletions

View File

@ -98,6 +98,36 @@ If you ran the build script, you can **simply run the license gen in interactive
**The license generator will spit out a JSON-formatted license which can then be used within the Bitwarden web front-end to license your user or org!**
## Migrating from mssql to a real database
Prepare a new database and bwdata directory, download and prepare the new settings.env (https://raw.githubusercontent.com/bitwarden/self-host/refs/heads/main/docker-unified/settings.env)
Make sure you can get the data from either the backup file or by connecting directly to the mssql database (navicat has a trial).
If required (e.g. you cannot connect to your docker mssql server directly) download Microsoft SQL Server 2022 and SQL Server Management Studio (the latter can be used to import the .bak file)
After cloning this repo and modifying .servers/serverlist.txt to suit your new environment do the following:
```
docker exec -i bitwarden-mssql /backup-db.sh
./bitwarden.sh stop
```
Run build.sh and ensure your new instance serves a webpage AND has populated the new database with the tables (should be empty now)
Proceed to stop the new container for now.
Copy from the old to the new bwdata directory (do not copy/overwrite identity.pfx!):
- bwdata/core/licenses to bwdata-new/licenses
- bwdata/core/aspnet-dataprotection to bwdata-new/data-protection
- bwdata/core/attachments to bwdata-new/attachments (untested for now)
Export data only from the old sql server database, if needed import the .bak file to a local mssql instance.
Only export tables that have rows, makes it much quicker, .json is the easiest with navicat.
Import the rows to the real database, start the new docker container.
---
# FAQ: Questions you might have.
@ -114,9 +144,20 @@ In the past we have done so but they were not focused on the type of customer th
UPDATE: Bitwarden now offers a cheap license called [Families Organization](https://bitwarden.com/pricing/) that provides premium features and the ability to self-host Bitwarden for six persons.
## 2fa doesn't work
Unfortunately the new BitWarden container doesn't set the timezone and ignores TZ= from the environment, can be fixed by:
```
docker exec bitwarden ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
```
## Changes in settings.env
Require a recreation of the docker container, build.sh will suffice too.
# Footnotes
<a name="#f1"><sup>1</sup></a>This tool builds on top of the `bitbetter/api` container image so make sure you've built that above using the root `./build.sh` script.
<a name="#f2"><sup>2</sup></a> If you wish to change this you'll need to change the value that `licenseGen/Program.cs` uses for its `GenerateUserLicense` and `GenerateOrgLicense` calls. Remember, this is really unnecessary as this certificate does not represent any type of security-related certificate.
<a name="#f2"><sup>2</sup></a> If you wish to change this you'll need to change the value that `licenseGen/Program.cs` uses for its `GenerateUserLicense` and `GenerateOrgLicense` calls. Remember, this is really unnecessary as this certificate does not represent any type of security-related certificate.

View File

@ -102,10 +102,11 @@ docker run -v "$TEMPDIRECTORY:/app/mount" --rm bitbetter/bitbetter
docker build . --tag bitwarden-patched --file "$PWD/src/bitBetter/Dockerfile-bitwarden-patch"
# start all user requested instances
if [ -f "$PWD/src/bitBetter/cert.cer" ]; then
if [ -f "$PWD/.servers/serverlist.txt" ]; then
# convert line endings to unix
sed -i 's/\r$//' "$PWD/.servers/serverlist.txt"
cat "$PWD/.servers/serverlist.txt" | while read -r LINE; do
if [[ $LINE == "#*" ]]; then
if [[ $LINE != "#"* ]]; then
bash -c "$LINE"
fi
done