Connecting MsSQL database to ONLYOFFICE Docs

Currently, there are no Docker variables that allow connecting with MsSQL; the user must perform the steps manually. The steps to connect MsSQL database to ONLYOFFICE Docs are as follows:

  1. Install ONLYOFFICE Docs:
    sudo docker run -i -t -d -p 80:80 --name onlyoffice \
    onlyoffice/documentserver
  2. Install MsSQL on the same or a separate server:
    sudo docker run -p 8080:1433 -d --name mssql  \
    -e "ACCEPT_EULA=Y" \
    -e "MSSQL_SA_PASSWORD=onlYoff1ce" \
    mcr.microsoft.com/mssql/server:2022-latest
  3. Download a script for creating tables and copy it to the container; afterward, create a database and run the script:
    wget https://github.com/ONLYOFFICE/server/raw/master/schema/mssql/createdb.sql
    sudo docker cp ./createdb.sql mssql:/
    sudo docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P onlYoff1ce -Q "CREATE DATABASE onlyoffice;"
    sudo docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P onlYoff1ce -Q "GO"
    sudo docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P onlYoff1ce -i /createdb.sql
    
  4. Change the parameters responsible for establishing a connection in local.json and switch Document Server to MsSQL:
    sudo docker exec -it onlyoffice bash
    nano /etc/onlyoffice/documentserver/local.json
    {"services": {"CoAuthoring": {"sql": {"type": "mssql","dbHost": "mssql_ip_or_hostname","dbPort": "8080","dbName": "onlyoffice","dbUser": "sa","dbPass": "onlYoff1ce"...
    supervisorctl restart all

Host ONLYOFFICE Docs on your own server or use it in the cloud

Article with the tag:
Browse all tags