diff --git a/changelog b/changelog
index ceb2786c..429d79e3 100644
--- a/changelog
+++ b/changelog
@@ -9,12 +9,16 @@ libreoffice (1:6.4.1~rc2~git20190216-1) UNRELEASED; urgency=medium
     so that libsduilo.so is actually installed into -draw instead of
     -core
   * debian/control.in:
-    - make -draw Replaces: -core (<< 1:6.4.1~rc1-3)
     - make -base Pre-Depends: dpkg (>= 1.19.1) (closes: #951149)
   * debian/libreoffice-nlpsolver.bug-script.in: add analogous to
     wiki-publisher
   * debian/libreoffice-ogltrans.bug-script.in: remove ...
   * debian/libreoffice-impress.bug-scrip.in: ... and merge here.
+  * debian/rules:
+    - move soffice.cfg modules to corresponding packages and remove *.ui
+      in the -nogui packages
+  * debian/control.in:
+    - update for sdui and soffice.cfg moves
 
  -- Rene Engelhard <rene@debian.org>  Sun, 09 Feb 2020 22:39:27 +0100
 
diff --git a/control.in b/control.in
index 86c1b428..a5607c41 100644
--- a/control.in
+++ b/control.in
@@ -310,8 +310,8 @@ Suggests: fonts-crosextra-caladea,
           libreoffice-base,
           ${java-common-depends},
           ${java-runtime-depends}
-Replaces: libreoffice-common (<< 1:5.4.1)
-Breaks: libreoffice-common (<< 1:5.4.1)
+Replaces: libreoffice-common (<< 1:6.4.1~rc2-1)
+Breaks: libreoffice-common (<< 1:6.4.1~rc2-1)
 Description: office productivity suite -- word processor
  LibreOffice is a full-featured office productivity suite that provides
  a near drop-in replacement for Microsoft(R) Office.
@@ -347,8 +347,8 @@ Depends: libreoffice-base-core (= ${binary:Version})%OOO_NO_BASE_ARCHS%,
          ${misc:Depends},
          ${shlibs:Depends}
 Suggests: ocl-icd-libopencl1 | mesa-opencl-icd | beignet-opencl-icd
-Replaces: libreoffice-common (<< 1:5.4.1)
-Breaks: libreoffice-common (<< 1:5.4.1)
+Replaces: libreoffice-common (<< 1:6.4.1~rc2-1)
+Breaks: libreoffice-common (<< 1:6.4.1~rc2-1)
 Description: office productivity suite -- spreadsheet
  LibreOffice is a full-featured office productivity suite that provides
  a near drop-in replacement for Microsoft(R) Office.
@@ -378,10 +378,10 @@ Depends: libreoffice-core (= ${binary:Version}) | libreoffice-core-nogui (= ${bi
          libreoffice-draw (= ${binary:Version}),
          ${misc:Depends},
          ${shlibs:Depends}
-Replaces: libreoffice-common (<< 1:5.4.1), libreoffice-ogltrans (<< 1:6.1.4-2~)
+Replaces: libreoffice-common (<< 1:6.4.1~rc2-1), libreoffice-ogltrans (<< 1:6.1.4-2~)
 Conflicts: libreoffice-ogltrans (<< 1:6.1.4-2~)
 Provides: libreoffice-ogltrans
-Breaks: libreoffice-common (<< 1:5.4.1)
+Breaks: libreoffice-common (<< 1:6.4.1~rc2-1)
 Description: office productivity suite -- presentation
  LibreOffice is a full-featured office productivity suite that provides
  a near drop-in replacement for Microsoft(R) Office.
@@ -408,8 +408,8 @@ Architecture: %OOO_ARCHS%
 Depends: libreoffice-core (= ${binary:Version}) | libreoffice-core-nogui (= ${binary:Version}),
          ${misc:Depends},
          ${shlibs:Depends}
-Replaces: libreoffice-core (<< 1:6.4.1~rc1-3), libreoffice-impress (<< 1:5.2.0-2), libreoffice-common (<< 1:5.4.1)
-Breaks: libreoffice-core (<< 1:6.4.1~rc1-3), libreoffice-impress (<< 1:5.2.0-2), libreoffice-common (<< 1:5.4.1)
+Replaces: libreoffice-core (<< 1:6.4.1~rc1-3), libreoffice-impress (<< 1:5.2.0-2), libreoffice-common (<< 1:6.4.1~rc2-1)
+Breaks: libreoffice-core (<< 1:6.4.1~rc1-3), libreoffice-impress (<< 1:5.2.0-2), libreoffice-common (<< 1:6.4.1~rc2-1)
 Description: office productivity suite -- drawing
  LibreOffice is a full-featured office productivity suite that provides
  a near drop-in replacement for Microsoft(R) Office.
@@ -488,7 +488,8 @@ Suggests: libreoffice-report-builder,
           unixodbc,
           python3-uno
 Recommends: libreoffice-writer, ${java-common-depends}, ${java-runtime-depends}
-Replaces: libreoffice-common (<< 1:4.3.0~beta1)
+Replaces: libreoffice-common (<< 1:6.4.1~rc2-1)
+Breaks: libreoffice-common (<< 1:6.4.1~rc2-1)
 Description: office productivity suite -- database
  LibreOffice is a full-featured office productivity suite that provides
  a near drop-in replacement for Microsoft(R) Office.
diff --git a/rules b/rules
index d0dd5714..43bef032 100755
--- a/rules
+++ b/rules
@@ -2473,6 +2473,30 @@ ifeq "$(ENABLE_FIREBIRD)" "y"
   endif
 endif
 
+	# move soffice.cfg files into the "correct" packages
+	mkdir -p $(PKGDIR)-base/$(OODIR)/share/config/soffice.cfg
+	mv $(PKGDIR)-common/$(OODIR)/share/config/soffice.cfg/dbaccess \
+		$(PKGDIR)-base/$(OODIR)/share/config/soffice.cfg
+	mkdir -p $(PKGDIR)-base/$(OODIR)/share/config/soffice.cfg/modules
+	for i in dbapp dbbrowser dbquery dbrelation dbtable dbtdata \
+		sabpilot sbibliography; do \
+		mv $(PKGDIR)-common/$(OODIR)/share/config/soffice.cfg/modules/$$i \
+			$(PKGDIR)-base/$(OODIR)/share/config/soffice.cfg/modules; \
+	done
+	mkdir -p $(PKGDIR)-report-builder/$(OODIR)/share/config/soffice.cfg/modules
+	mv $(PKGDIR)-common/$(OODIR)/share/config/soffice.cfg/modules/dbreport \
+		$(PKGDIR)-report-builder/$(OODIR)/share/config/soffice.cfg/modules
+	for i in calc draw impress math writer; do \
+		mkdir -p $(PKGDIR)-$$i/$(OODIR)/share/config/soffice.cfg/modules; \
+		mv $(PKGDIR)-common/$(OODIR)/share/config/soffice.cfg/modules/s$$i \
+			$(PKGDIR)-$$i/$(OODIR)/share/config/soffice.cfg/modules; \
+	done
+	mkdir -p $(PKGDIR)-writer/$(OODIR)/share/config/soffice.cfg/modules
+	for i in sweb swform swreport swxform writerperfect; do \
+		mv $(PKGDIR)-common/$(OODIR)/share/config/soffice.cfg/modules/$$i \
+			$(PKGDIR)-writer/$(OODIR)/share/config/soffice.cfg/modules; \
+	done
+
 	find debian/tmp ! -perm -200 | xargs -r chmod u+w
 
 	touch $@
@@ -2845,12 +2869,13 @@ ifeq "$(BUILD_NOGUI_PACKAGES)" "y"
 	done
 	# remove lib*uilo.so in --nogui
 	find debian/libreoffice-*-nogui/$(OODIR)/program/lib*uilo.so -exec rm {} \;
-	find debian/libreoffice-base-nogui/$(OODIR)/program/libdbulo.so -exec rm {} \;
-	# and (no UI, so not needed) not needed .desktop files
+	rm -f debian/libreoffice-base-nogui/$(OODIR)/program/libdbulo.so
+	# and (no UI, so not needed) not needed .desktop and .ui files
 	find debian/libreoffice-*-nogui/usr/share/applications/*.desktop -exec rm {} \;
+	find debian/libreoffice-*-nogui/$(OODIR)/share/config/soffice.cfg -name "*.ui" -exec rm {} \;
 	# unneeded launchers
 	find debian/libreoffice-*-nogui/usr/bin/lo* -exec rm {} \;
-	# otherwise we get errors
+	# otherwise we get errors since the launchers are missing
 	find debian/libreoffice-*-nogui/usr/share/metainfo/libreoffice-*.appdata.xml -exec rm {} \;
 endif
 
