<p>Plugin Migrations run as soon as <a href="http://www.yiiframework.com/doc/guide/1.1/de/database.migration" rel="nofollow noreferrer">Yii</a> finds a new file. So as soon as there is a new file in your migration folder Craft starts to migrate it the next time someone triggers Craft tasks (usually by entering the CP). When you hit the <code>Update</code> button in your CP there could be that chance that a plugin makes an update -> pulls those migration files. </p>

<p>What do you mean with "how to debug this"?</p>

<p>If you want to remove the task, you can clear the task table and get rid of it. You can take a look at the plugins migration folder and see if there are any new files.</p>

CC BY-SA 3.0
2018-02-22T14:42:24.027Z
So the weird thing is this is on a live site, where auto update is off and thus no new files (all published via GIT too).

Basically it's taking the site offline on it's own, which isn't great.
Tom Carwardine
CC BY-SA 3.0
2018-02-22T14:44:33.250Z
What I mean by debug is try to find why a migration would run over and over again, with an interval of a few days. The plugin version in the DB is correct, and the migration dates are in the past so it's very weird.
Tom Carwardine
CC BY-SA 3.0
2018-02-22T14:47:02.490Z
Migration dates must be in the past otherwise Yii won't recognize them. Maybe there was an error in the plugin and it didn't save the migration in the `migrations` table in the end -> it runs again and again because it doesn't know the migration is already implemented
Robin Schambach
CC BY-SA 3.0
2018-02-22T14:48:55.280Z
That would figure, but we've had the plugin in use for over a year and it's had no updates in the last few months. I guess I could remove and reinstall but as it's a form collection plugin there's a lot of DB info that cant be deleted.. Thanks for helping btw :)
Tom Carwardine
CC BY-SA 3.0
2018-02-22T14:50:26.707Z
It's deff adding the migrations to the table, I can see the recent ones which are post the date of the recent site update, so I guess my starting point has to be why they are in the table with that date when nothing has changed.
Tom Carwardine
CC BY-SA 3.0
2018-02-22T15:22:09.483Z
So it seems the Formerly plugin has no schema version set in it's file, so have hacked in my own on the hope that this will ensure that migrations that have run don't run again. Fingers crossed.
Tom Carwardine
CC BY-SA 3.0
2018-02-22T14:38:25.553Z
2018-02-22T14:38:25.553Z
Robin Schambach
<p>I'm a bit stumped with this one and wonder if anyone else has come across it.</p>

<p>I've a site live which is using the 'Formerly' plugin amongst others, since a recent update the site has gone offline twice in the last week do to the formerly plugin needing to make changes to the database.</p>

<p>I didn't think this could happen on it's own? It's like the plugins migration wants to run on it's own at weird intervals.</p>

<p>Not sure how to debug this, anyone else had this issue?</p>

<plugins><migration>
Migrations running on their own causing site down
# Migrations running on their own causing site down

(Asked by: username_0 on 2018-02-22)

I'm a bit stumped with this one and wonder if anyone else has come across it.

I've a site live which is using the 'Formerly' plugin amongst others, since a recent update the site has gone offline twice in the last week do to the formerly plugin needing to make changes to the database.

I didn't think this could happen on it's own? It's like the plugins migration wants to run on it's own at weird intervals.

Not sure how to debug this, anyone else had this issue?

**Tags:** plugins, migration

---

## 1 answers

### Answer by username_1 on 2018-02-22. Score: 1

Plugin Migrations run as soon as [Yii](http://www.yiiframework.com/doc/guide/1.1/de/database.migration) finds a new file. So as soon as there is a new file in your migration folder Craft starts to migrate it the next time someone triggers Craft tasks (usually by entering the CP). When you hit the `Update` button in your CP there could be that chance that a plugin makes an update -> pulls those migration files.

What do you mean with "how to debug this"?

If you want to remove the task, you can clear the task table and get rid of it. You can take a look at the plugins migration folder and see if there are any new files.

> **Comments:**
> **username_0**: So the weird thing is this is on a live site, where auto update is off and thus no new files (all published via GIT too).  Basically it's taking the site offline on it's own, which isn't great.  
> **username_0**: What I mean by debug is try to find why a migration would run over and over again, with an interval of a few days. The plugin version in the DB is correct, and the migration dates are in the past so it's very weird.  
> **username_1**: Migration dates must be in the past otherwise Yii won't recognize them. Maybe there was an error in the plugin and it didn't save the migration in the `migrations` table in the end -> it runs again and again because it doesn't know the migration is already implemented  
> **username_0**: That would figure, but we've had the plugin in use for over a year and it's had no updates in the last few months. I guess I could remove and reinstall but as it's a form collection plugin there's a lot of DB info that cant be deleted.. Thanks for helping btw :)  
> **username_0**: It's deff adding the migrations to the table, I can see the recent ones which are post the date of the recent site update, so I guess my starting point has to be why they are in the table with that date when nothing has changed.  
> **username_0**: So it seems the Formerly plugin has no schema version set in it's file, so have hacked in my own on the hope that this will ensure that migrations that have run don't run again. Fingers crossed.  

---

