diff --git a/CHANGES/v2.5.md b/CHANGES/v2.5.md
index e16cc58fce8cfc173ed30e4f69871c553d778961..5f588ff6bd2e7df74f79bf5366b7d56faa56c3e4 100644
--- a/CHANGES/v2.5.md
+++ b/CHANGES/v2.5.md
@@ -177,5 +177,5 @@ For users:
 For users:
 - New shortcuts are available for selecting protein atoms: `@chi2-#`, `@chi3-#`,`@chi4-#` and `@chi5-#`
 - Fixed performance of \ref CUSTOM when having zero derivatives with respect to some arguments.
-- New patch for GROMACS 2019.1
+- New patch for GROMACS 2019.2
 - Module VES: Fixed performance of \ref BF_CUSTOM for basis functions with linear terms (e.g. having zero derivatives). 
diff --git a/patches/gromacs-2019.1.config b/patches/gromacs-2019.2.config
similarity index 100%
rename from patches/gromacs-2019.1.config
rename to patches/gromacs-2019.2.config
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/CMakeLists.txt b/patches/gromacs-2019.2.diff/src/gromacs/CMakeLists.txt
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/CMakeLists.txt
rename to patches/gromacs-2019.2.diff/src/gromacs/CMakeLists.txt
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/CMakeLists.txt.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/CMakeLists.txt.preplumed
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/CMakeLists.txt.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/CMakeLists.txt.preplumed
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdlib/force.cpp b/patches/gromacs-2019.2.diff/src/gromacs/mdlib/force.cpp
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdlib/force.cpp
rename to patches/gromacs-2019.2.diff/src/gromacs/mdlib/force.cpp
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdlib/force.cpp.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdlib/force.cpp.preplumed
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdlib/force.cpp.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdlib/force.cpp.preplumed
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.cpp b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.cpp
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.cpp
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.cpp
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.h b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.h
similarity index 98%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.h
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.h
index 01454f92678bc800038d22a31654b84518a0e6c2..019a12439e4f9cf6031b8d82ca17f3d6426015c2 100644
--- a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.h
+++ b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.h
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -252,7 +252,7 @@ class LegacyMdrunOptions
             { "-append",  FALSE, etBOOL, {&bTryToAppendFiles},
               "Append to previous output files when continuing from checkpoint instead of adding the simulation part number to all file names" },
             { "-nsteps",  FALSE, etINT64, {&mdrunOptions.numStepsCommandline},
-              "Run this number of steps, overrides .mdp file option (-1 means infinite, -2 means use mdp option, smaller is invalid)" },
+              "Run this number of steps (-1 means infinite, -2 means use mdp option, smaller is invalid)" },
             { "-maxh",   FALSE, etREAL, {&mdrunOptions.maximumHoursToRun},
               "Terminate after 0.99 times this time (hours)" },
             { "-replex",  FALSE, etINT, {&replExParams.exchangeInterval},
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed
similarity index 98%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed
index 637cd2a6b93dabe9fd632d92e30794922c3a8fec..27a6de629a3ef033a86802560cbb175e748ee4c9 100644
--- a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed
+++ b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -241,7 +241,7 @@ class LegacyMdrunOptions
             { "-append",  FALSE, etBOOL, {&bTryToAppendFiles},
               "Append to previous output files when continuing from checkpoint instead of adding the simulation part number to all file names" },
             { "-nsteps",  FALSE, etINT64, {&mdrunOptions.numStepsCommandline},
-              "Run this number of steps, overrides .mdp file option (-1 means infinite, -2 means use mdp option, smaller is invalid)" },
+              "Run this number of steps (-1 means infinite, -2 means use mdp option, smaller is invalid)" },
             { "-maxh",   FALSE, etREAL, {&mdrunOptions.maximumHoursToRun},
               "Terminate after 0.99 times this time (hours)" },
             { "-replex",  FALSE, etINT, {&replExParams.exchangeInterval},
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/md.cpp b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/md.cpp
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/md.cpp
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/md.cpp
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/md.cpp.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/md.cpp.preplumed
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/md.cpp.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/md.cpp.preplumed
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/minimize.cpp b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/minimize.cpp
similarity index 99%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/minimize.cpp
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/minimize.cpp
index e677e23f36ee59f95c5a170e417c12d744716035..6fb913acdf7fda216bd50c6a63cb04f973064344 100644
--- a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/minimize.cpp
+++ b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/minimize.cpp
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -2218,15 +2218,15 @@ Integrator::do_lbfgs()
                 {
                     /* Replace c endpoint with b */
                     c   = b;
-                    /* swap states b and c */
-                    swap_em_state(&sb, &sc);
+                    /* copy state b to c */
+                    *sc = *sb;
                 }
                 else
                 {
                     /* Replace a endpoint with b */
                     a   = b;
-                    /* swap states a and b */
-                    swap_em_state(&sa, &sb);
+                    /* copy state b to a */
+                    *sa = *sb;
                 }
 
                 /*
@@ -2428,7 +2428,7 @@ Integrator::do_lbfgs()
         }
 
         // Reset stepsize in we are doing more iterations
-        stepsize = 1.0/ems.fnorm;
+        stepsize = 1.0;
 
         /* Stop when the maximum force lies below tolerance.
          * If we have reached machine precision, converged is already set to true.
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/minimize.cpp.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/minimize.cpp.preplumed
similarity index 99%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/minimize.cpp.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/minimize.cpp.preplumed
index eb8e910468fd99643d8d9f5aa061caa7a10c13ab..77421a32af2150f87ad728007fa66bd100d3a98c 100644
--- a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/minimize.cpp.preplumed
+++ b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/minimize.cpp.preplumed
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -2143,15 +2143,15 @@ Integrator::do_lbfgs()
                 {
                     /* Replace c endpoint with b */
                     c   = b;
-                    /* swap states b and c */
-                    swap_em_state(&sb, &sc);
+                    /* copy state b to c */
+                    *sc = *sb;
                 }
                 else
                 {
                     /* Replace a endpoint with b */
                     a   = b;
-                    /* swap states a and b */
-                    swap_em_state(&sa, &sb);
+                    /* copy state b to a */
+                    *sa = *sb;
                 }
 
                 /*
@@ -2353,7 +2353,7 @@ Integrator::do_lbfgs()
         }
 
         // Reset stepsize in we are doing more iterations
-        stepsize = 1.0/ems.fnorm;
+        stepsize = 1.0;
 
         /* Stop when the maximum force lies below tolerance.
          * If we have reached machine precision, converged is already set to true.
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.cpp b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.cpp
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.cpp
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.cpp
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.h b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.h
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.h
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.h
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.h.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.h.preplumed
similarity index 100%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/replicaexchange.h.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/replicaexchange.h.preplumed
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/runner.cpp b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/runner.cpp
similarity index 99%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/runner.cpp
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/runner.cpp
index 39608a5f8f748cace878c131e23736bed38cd75a..ac29a3926d13b7b311cda18900a94aa5f3ffadba 100644
--- a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/runner.cpp
+++ b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/runner.cpp
@@ -855,6 +855,15 @@ int Mdrunner::mdrunner()
          */
         gmx_bool bReadEkin;
 
+        if (mdrunOptions.numStepsCommandline > -2)
+        {
+            /* Temporarily set the number of steps to unmlimited to avoid
+             * triggering the nsteps check in load_checkpoint().
+             * This hack will go away soon when the -nsteps option is removed.
+             */
+            inputrec->nsteps = -1;
+        }
+
         load_checkpoint(opt2fn_master("-cpi", filenames.size(), filenames.data(), cr),
                         logFileHandle,
                         cr, domdecOptions.numCells,
diff --git a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/runner.cpp.preplumed b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/runner.cpp.preplumed
similarity index 99%
rename from patches/gromacs-2019.1.diff/src/gromacs/mdrun/runner.cpp.preplumed
rename to patches/gromacs-2019.2.diff/src/gromacs/mdrun/runner.cpp.preplumed
index ae158a4984deefd1d61ca9e2a912143db1c75e05..370cff95f94c657027b79afd16368f194ac41918 100644
--- a/patches/gromacs-2019.1.diff/src/gromacs/mdrun/runner.cpp.preplumed
+++ b/patches/gromacs-2019.2.diff/src/gromacs/mdrun/runner.cpp.preplumed
@@ -855,6 +855,15 @@ int Mdrunner::mdrunner()
          */
         gmx_bool bReadEkin;
 
+        if (mdrunOptions.numStepsCommandline > -2)
+        {
+            /* Temporarily set the number of steps to unmlimited to avoid
+             * triggering the nsteps check in load_checkpoint().
+             * This hack will go away soon when the -nsteps option is removed.
+             */
+            inputrec->nsteps = -1;
+        }
+
         load_checkpoint(opt2fn_master("-cpi", filenames.size(), filenames.data(), cr),
                         logFileHandle,
                         cr, domdecOptions.numCells,