diff --git a/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py b/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py
index 2f4fe4609bb0fe240e097b5f89a238233f1d2009..04cb1fd2a270dba10f2cd03959f9d183cef8012c 100755
--- a/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py
+++ b/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py
@@ -7,13 +7,25 @@
 # It creates separate files for filling the tables.
 # The script assumes the infile is a dump of a MySQL MoM 3 database.
 
-# To use this script, change the first 4 variables defined below.
+# To use this script, change the variables defined below.
 
 infile = "backup_lofar_mom3.sql.1"
 indatabase = "lofar_mom3"
 outdatabase = "lofar_mom_test_rt_trigger"
 outdir = "test/"
 
+# You probably want to run this script on copies of lofar_mom3, lofar_mom3privileges
+# useradministration and lofar_idm.
+# The results can be fed to mysql with a command like:
+# > ls -1 *.sql | awk '{ print "source",$0 }' | mysql --batch -u <user> -h mysqltest1.control.lofar -p<password>
+
+# If you leave these blank or have them the same as indatabase, the script will skip them.
+# The core MoM database references these.
+inIDMdatabase = "lofar_idm"
+outIDMdatabase = "lofar_mom_test_rt_trigger_idm"
+inUserAdmindatabase = "useradministration"
+outUserAdmindatabase = "lofar_mom_test_rt_trigger_useradmin"
+
 outfile = open(outdir +"000000_CREATE_DATABASE.sql", 'w')
 
 # Please note that "Comments" in the SQL that look like this
@@ -86,6 +98,10 @@ with open(infile) as f:
             # "/*!50001 VIEW" are special BiRT viewer generated views
             if indatabase in line: #doing this for each line would be expensive
                 line = line.replace(indatabase, outdatabase)
+            if inIDMdatabase and (indatabase != inIDMdatabase) and inIDMdatabase in line: 
+                line = line.replace(inIDMdatabase, outIDMdatabase)
+            if inUserAdmindatabase and (indatabase != inUserAdmindatabase) and inUserAdmindatabase in line: 
+                line = line.replace(inUserAdmindatabase, outUserAdmindatabase)
         if line[0:3] == "USE":
             if use_found:
                 outfile = open(outdir + "%06d_" % line_nr + "USE_%s.sql" % outdatabase, 'w')